Initial revisin of healthchecker, inspired by HAProxy

This commit is contained in:
2026-04-10 17:30:44 +02:00
commit b84b3274b1
24 changed files with 4400 additions and 0 deletions

30
Makefile Normal file
View File

@@ -0,0 +1,30 @@
BINARY := healthchecker
MODULE := git.ipng.ch/ipng/vpp-maglev
PROTO_DIR := proto
PROTO_FILE := $(PROTO_DIR)/healthchecker.proto
GEN_FILES := internal/grpcapi/healthchecker.pb.go internal/grpcapi/healthchecker_grpc.pb.go
.PHONY: all build test proto lint clean
all: build
build: $(GEN_FILES)
go build -o bin/$(BINARY) ./cmd/$(BINARY)/
test: $(GEN_FILES)
go test ./...
proto: $(GEN_FILES)
$(GEN_FILES): $(PROTO_FILE)
protoc \
--go_out=. --go_opt=module=$(MODULE) \
--go-grpc_out=. --go-grpc_opt=module=$(MODULE) \
$(PROTO_FILE)
lint:
golangci-lint run ./...
clean:
rm -f bin/$(BINARY)
rm -f $(GEN_FILES)