Documentation
¶
Overview ¶
Package grpcserver provides a lakta module for running gRPC servers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Instance name
Name string `koanf:"-"`
// Host specifies the address for the GRPC server to bind to.
Host string `koanf:"host"`
// Port represents the port number on which the GRPC server listens.
Port uint16 `koanf:"port"`
// HealthCheck determines whether gRPC health checking is enabled or disabled.
HealthCheck bool `koanf:"health_check"`
// Services is a map of gRPC service descriptors and their implementations to be registered on the server.
Services map[*grpc.ServiceDesc]any `code_only:"WithService" koanf:"-"`
}
Config represents configuration for GRPC server Module
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig returns default configuration
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module manages a gRPC server lifecycle.
func (*Module) ConfigPath ¶
ConfigPath returns the koanf path for this module's configuration.
func (*Module) LoadConfig ¶
LoadConfig loads configuration from koanf.
type Option ¶
type Option func(m *Config)
Option configures the Module.
func WithHealthCheck ¶ added in v0.0.2
WithHealthCheck enables or disables the gRPC health check.
func WithService ¶
func WithService(serviceDescriptor *grpc.ServiceDesc, service any) Option
WithService adds service to the list of services to be registered (code-only).
Click to show internal directories.
Click to hide internal directories.