mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-05 12:13:42 +02:00
Merge branch 'dev'
This commit is contained in:
commit
efa0e71f03
3 changed files with 45 additions and 8 deletions
12
Makefile
12
Makefile
|
|
@ -1,14 +1,14 @@
|
||||||
|
|
||||||
PROGRAM_NAME = antelope-api-healthcheck
|
PROGRAM_NAME = antelope-api-healthcheck
|
||||||
export PROGRAM_VERSION = 1.4.6
|
export PROGRAM_VERSION = 1.4.6
|
||||||
|
|
||||||
GO = go
|
GO = go
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
export GOOS = $(shell $(GO) env GOOS)
|
export GOOS = $(shell $(GO) env GOOS)
|
||||||
export GOARCH = $(shell $(GO) env GOARCH)
|
export GOARCH = $(shell $(GO) env GOARCH)
|
||||||
GOBUILDFLAGS = -v -ldflags='-v -s -w -X main.VersionString=$(PROGRAM_VERSION)'
|
GOBUILDFLAGS = -v -ldflags='-v -s -w -X main.VersionString=$(PROGRAM_VERSION)'
|
||||||
|
|
||||||
DPKG_BUILDPACKAGE = dpkg-buildpackage
|
DPKG_BUILDPACKAGE = dpkg-buildpackage
|
||||||
DPKG_BUILDPACKAGE_FLAGS = -b -uc
|
DPKG_BUILDPACKAGE_FLAGS = -b -uc
|
||||||
|
|
||||||
.PHONY: all build/$(PROGRAM_NAME) build/antelope-v1-mock-server clean package_debian
|
.PHONY: all build/$(PROGRAM_NAME) build/antelope-v1-mock-server clean package_debian
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@ This program implements Antelope healthcheck for HAProxy over TCP.
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
You will need go-lang version `1.16` or later to compile the source.
|
You will need golang version `1.16` or later to compile the source.
|
||||||
|
|
||||||
compile with `compile.sh` script
|
compile with `compile.sh` script
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ./compile.sh
|
./compile.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Execute `./compile.sh --help` to see all available flags to crosscompile for different systems/architectures.
|
Execute `./compile.sh --help` to see all available flags to crosscompile for different systems/architectures.
|
||||||
|
|
|
||||||
37
internal/api/make_test.go
Normal file
37
internal/api/make_test.go
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestMakeV1(t *testing.T) {
|
||||||
|
api, err := Make("v1", ApiArguments{})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.IsType(t, AntelopeV1{}, api)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMakeV2(t *testing.T) {
|
||||||
|
api, err := Make("v2", ApiArguments{})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.IsType(t, AntelopeV2{}, api)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMakeAtomic(t *testing.T) {
|
||||||
|
api, err := Make("atomic", ApiArguments{})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.IsType(t, AtomicAsset{}, api)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMakeDebug(t *testing.T) {
|
||||||
|
api, err := Make("debug", ApiArguments{})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.IsType(t, DebugApi{}, api)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestMakeInvalid(t *testing.T) {
|
||||||
|
api, err := Make("invalid", ApiArguments{})
|
||||||
|
assert.Error(t, err)
|
||||||
|
assert.Nil(t, api)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue