Documentation
¶
Overview ¶
Package grpc provides a gRPC transport for the controls lifecycle controller, enabling remote service management and health checking over gRPC.
Index ¶
- func NewServer(cfg config.Containable, opt ...grpc.ServerOption) (*grpc.Server, error)
- func Register(ctx context.Context, id string, controller controls.Controllable, ...) (*grpc.Server, error)
- func RegisterHealthService(srv *grpc.Server, controller healthSource)
- func Start(cfg config.Containable, logger logger.Logger, srv *grpc.Server) controls.StartFunc
- func Status(srv *grpc.Server) controls.StatusFunc
- func Stop(logger logger.Logger, srv *grpc.Server) controls.StopFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer(cfg config.Containable, opt ...grpc.ServerOption) (*grpc.Server, error)
NewServer returns a new preconfigured grpc.Server.
func Register ¶
func Register(ctx context.Context, id string, controller controls.Controllable, cfg config.Containable, logger logger.Logger, opt ...grpc.ServerOption) (*grpc.Server, error)
Register creates a new gRPC server and registers it with the controller under the given id.
func RegisterHealthService ¶
RegisterHealthService registers the standard gRPC health service with the provided server, wired to the controller's status.
func Status ¶
func Status(srv *grpc.Server) controls.StatusFunc
Status returns a curried function suitable for use with the controls package.
func Stop ¶
Stop returns a curried function suitable for use with the controls package. GracefulStop is attempted first to allow in-flight RPCs to finish. If the shutdown context expires (or if Serve has not been called yet, which would cause GracefulStop to block indefinitely), the server is force-stopped.
Types ¶
This section is empty.