Documentation ¶
Index ¶
- func LoggerMiddleware(logger *zap.Logger) func(http.Handler) http.Handler
- type GRPCServer
- type GRPCServerConfig
- type GRPCServerOption
- func GRPCWithServerName(serverName string) GRPCServerOption
- func GRPCWithServerOptions(opts ...grpc.ServerOption) GRPCServerOption
- func GRPCWithStreamInterceptors(ins ...grpc.StreamServerInterceptor) GRPCServerOption
- func GRPCWithUnaryInterceptors(ins ...grpc.UnaryServerInterceptor) GRPCServerOption
- type HTTPServerOption
- type HTTPServerWrapper
- type ServerConfig
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCServer ¶
func NewGRPCServer ¶
func NewGRPCServer(cfg GRPCServerConfig, logger *zap.Logger, opts ...GRPCServerOption) *GRPCServer
func (*GRPCServer) ForcefullyStop ¶
func (s *GRPCServer) ForcefullyStop() error
func (*GRPCServer) GracefullyStop ¶
func (s *GRPCServer) GracefullyStop() error
func (*GRPCServer) Run ¶
func (s *GRPCServer) Run() error
type GRPCServerConfig ¶
type GRPCServerConfig struct { Port int64 `yaml:"port"` EnableRecover bool `yaml:"enable_recover"` // TODO write recover and tls EnableReflection bool `yaml:"enable_reflection"` }
func (*GRPCServerConfig) Validate ¶
func (c *GRPCServerConfig) Validate() error
type GRPCServerOption ¶
type GRPCServerOption func(serverOptions *grpcServerOptions)
func GRPCWithServerName ¶
func GRPCWithServerName(serverName string) GRPCServerOption
func GRPCWithServerOptions ¶
func GRPCWithServerOptions(opts ...grpc.ServerOption) GRPCServerOption
func GRPCWithStreamInterceptors ¶
func GRPCWithStreamInterceptors(ins ...grpc.StreamServerInterceptor) GRPCServerOption
func GRPCWithUnaryInterceptors ¶
func GRPCWithUnaryInterceptors(ins ...grpc.UnaryServerInterceptor) GRPCServerOption
type HTTPServerOption ¶
type HTTPServerOption func(*httpServerOption)
func WithAdminServer ¶
func WithAdminServer(cfg ServerConfig) HTTPServerOption
func WithPublicServer ¶
func WithPublicServer(cfg ServerConfig, mux *chi.Mux) HTTPServerOption
type HTTPServerWrapper ¶
type HTTPServerWrapper struct {
// contains filtered or unexported fields
}
func NewHTTPServerWrapper ¶
func NewHTTPServerWrapper(logger *zap.Logger, opts ...HTTPServerOption) *HTTPServerWrapper
func (*HTTPServerWrapper) GracefulStop ¶
func (h *HTTPServerWrapper) GracefulStop() []func() error
func (*HTTPServerWrapper) Run ¶
func (h *HTTPServerWrapper) Run() []func() error
type ServerConfig ¶
type ServerConfig struct { Enable bool `yaml:"enable"` Endpoint string `yaml:"endpoint"` Port int `yaml:"port" env:"PORT"` JwtTokenSalt string `yaml:"jwt_token_salt" env:"JWT_TOKEN_SALT"` }
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
type ServerOption ¶
type ServerOption struct { Port int Mux *chi.Mux }
Click to show internal directories.
Click to hide internal directories.