Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(ctx context.Context, service Registerer, serverConfig *connection.ServerConfig) error
Serve creates a gRPC server and listener from the config, registers the service, and serves until the context is done. For services that only implement Registerer (e.g., mock services without Run/WaitForReady).
func StartAndServe ¶
func StartAndServe(ctx context.Context, service Service, serverConfigs ...*connection.ServerConfig) error
StartAndServe runs a full lifecycle service: starts the service, waits for it to be ready, then creates and serves gRPC server(s). Stops everything if either the service or any server exits.
Types ¶
type Registerer ¶
Registerer is for services that register on a gRPC server.
type Service ¶
type Service interface {
Registerer
// Run executes the service until the context is done.
Run(ctx context.Context) error
// WaitForReady waits for the service resources to initialize.
// If the context ended before the service is ready, returns false.
WaitForReady(ctx context.Context) bool
}
Service is for full lifecycle services that run, signal readiness, and register on a gRPC server.
Click to show internal directories.
Click to hide internal directories.