Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Enabled bool `default:"true" usage:"allows to enable grpc server" example:"true"` Addr string `default:":9000" validate:"required,hostname_port" usage:"grpc server listen address" example:"localhost:9000"` Network string `default:"tcp" required:"true" validate:"oneof=tcp udp" usage:"grpc server listen network: tpc/udp" example:"tcp"` ReflectEnabled bool `yaml:"reflect_enabled" default:"false" usage:"allows to enable grpc reflection service" example:"false"` HealthCheckEnabled bool `yaml:"health_check_enabled" default:"false" usage:"allows to enable grpc health checker" example:"false"` LoggerEnabled bool `yaml:"logger_enabled" default:"false" usage:"allows to enable logger. available only for default grpc sevrer" example:"false"` RecoveryEnabled bool `` /* 141-byte string literal not displayed */ }
Config provides configuration for grpc server.
type GRPCServer ¶
type GRPCServer struct { Config // contains filtered or unexported fields }
func NewServer ¶
func NewServer(opts ...Option) *GRPCServer
NewServer creates a new gRPC server that implements service.IService interface.
func (*GRPCServer) Enabled ¶
func (s *GRPCServer) Enabled() bool
Enabled returns is service enabled.
type GRPCService ¶
GRPCService custom interface for gRPC service.
type Option ¶
type Option func(s *GRPCServer)
Option allows customizing gRPC server.
func WithServices ¶
func WithServices(services ...GRPCService) Option
WithServices allows adding new gRPC Service.
Click to show internal directories.
Click to hide internal directories.