Documentation
¶
Overview ¶
Package grpcserver provides the app.module.grpcserver app module: a long-running gRPC server that hosts service modules registered through its services: config block. The Service interface is exported here so that service modules can satisfy it without importing google.golang.org/grpc from the top-level sessionmanager package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
Mod string `yaml:"module"`
Services []*config.ServiceCfg `yaml:"services"`
// contains filtered or unexported fields
}
Module is the gRPC server app. Its lifecycle:
- Provision: resolve every service module listed under services: the services are provisioned before this app by the loader's topological order (the app depends on its services), so they are looked up by ID rather than loaded here; collect them in declaration order.
- Start: build the underlying *grpc.Server via commongrpc.NewServer using the top-level cfg.GRPC block, register every collected service onto it, listen on cfg.GRPC.Address, and begin Serve in a goroutine.
- Stop: GracefulStop bounded by cfg.GRPC.ShutdownTimeout; if the timeout fires, fall back to a forceful Stop.
func (*Module) Module ¶
func (m *Module) Module() sessionmanager.ModuleInfo
type Service ¶
type Service interface {
Register(s grpc.ServiceRegistrar)
}
Service is the interface that every gRPC service module loaded under an app.module.grpcserver entry must satisfy. The grpc app calls Register on each child service, in declaration order, before invoking Serve.