Documentation
¶
Overview ¶
Package server runs the MidnightState gRPC service. It is a native google.golang.org/grpc server (not ConnectRPC) so that clients written against the Acropolis tonic service are byte-for-byte compatible. This package is the server scaffold: it registers a stub MidnightState service whose RPCs all return Unimplemented; the real handlers are added separately.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Logger *slog.Logger
// Host and Port are the gRPC listen address. Defaults to 0.0.0.0:50051.
Host string
Port uint
// TLSCertFilePath and TLSKeyFilePath enable TLS when both are set. When
// both are empty the server listens without TLS. Setting only one is an
// error.
TLSCertFilePath string
TLSKeyFilePath string
// ShutdownTimeout bounds GracefulStop before escalating to a hard Stop.
// Defaults to 30s.
ShutdownTimeout time.Duration
}
Config holds the configuration for the Midnight gRPC server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server runs the MidnightState gRPC service over its own listener.
func (*Server) Start ¶
Start binds the listener and serves the gRPC server in a background goroutine. Binding and any TLS keypair load happen synchronously so that address-in-use and certificate errors surface before Start returns. A goroutine watches ctx and performs a bounded graceful shutdown when it is cancelled.