Fixes + stable gateway ids

This commit is contained in:
Stephan D
2026-02-18 20:38:08 +01:00
parent 4dc182bfa2
commit 770c7b9da9
119 changed files with 3000 additions and 734 deletions

View File

@@ -1,3 +1,4 @@
// Package appversion exposes build-time version information for the discovery service.
package appversion
import (
@@ -14,6 +15,7 @@ var (
BuildDate string
)
// Create returns a version printer populated with the compile-time build metadata.
func Create() version.Printer { //nolint:ireturn // factory returns interface by design
info := version.Info{
Program: "Sendico Discovery Service",

View File

@@ -1,3 +1,4 @@
// Package serverimp contains the concrete discovery server implementation.
package serverimp
import (

View File

@@ -12,6 +12,7 @@ import (
const defaultShutdownTimeout = 15 * time.Second
// Create returns a new server implementation configured with the given logger, config file, and debug flag.
func Create(logger mlogger.Logger, file string, debug bool) (*Imp, error) {
return &Imp{
logger: logger.Named("server"),
@@ -20,6 +21,7 @@ func Create(logger mlogger.Logger, file string, debug bool) (*Imp, error) {
}, nil
}
// Start loads configuration, starts metrics and the discovery registry, then blocks until stopped.
func (i *Imp) Start() error {
i.initStopChannels()
defer i.closeDone()
@@ -73,6 +75,7 @@ func (i *Imp) Start() error {
return nil
}
// Shutdown gracefully stops the discovery service and its metrics server.
func (i *Imp) Shutdown() {
timeout := i.shutdownTimeout()
i.logger.Info("Stopping discovery service", zap.Duration("timeout", timeout))

View File

@@ -9,6 +9,7 @@ import (
"github.com/tech/sendico/pkg/mlogger"
)
// Imp is the concrete implementation of the discovery server application.
type Imp struct {
logger mlogger.Logger
file string

View File

@@ -1,3 +1,4 @@
// Package server provides the discovery service application factory.
package server
import (
@@ -6,6 +7,8 @@ import (
"github.com/tech/sendico/pkg/server"
)
// Create initialises and returns a new discovery server application.
//
//nolint:ireturn // factory returns interface by design
func Create(logger mlogger.Logger, file string, debug bool) (server.Application, error) {
return serverimp.Create(logger, file, debug) //nolint:wrapcheck

View File

@@ -1,3 +1,4 @@
// Package main is the entry point for the discovery service.
package main
import (