Documentation
¶
Overview ¶
Package server is a server builder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCOptions ¶ added in v0.1.6
GRPCOptions defines options for building a GRPCServer.
type GRPCServer ¶
func NewGRPCServer ¶ added in v0.1.5
func NewGRPCServer() (*GRPCServer, error)
NewGRPCServer builds an GRPCServer.
func (*GRPCServer) Run ¶
func (s *GRPCServer) Run() error
Run runs the HTTP server and conducts a self health check.
type HTTPOptions ¶ added in v0.1.6
type HTTPOptions struct {
Mode string
Addr string
Middlewares []string
PingTimeout time.Duration `mapstructure:"ping-timeout"`
Healthz bool
Metrics bool
Profiling bool
}
HTTPOptions defines options for building an HTTPServer.
type HTTPServer ¶
HTTPServer is both a HTTPServer and a gin.Engine.
func NewHTTPServer ¶ added in v0.1.5
func NewHTTPServer() (*HTTPServer, error)
NewHTTPServer builds an HTTPServer.
func (*HTTPServer) Run ¶
func (s *HTTPServer) Run() error
Run runs the HTTP server and conducts a self health check.
type Option ¶ added in v0.3.0
type Option interface {
// contains filtered or unexported methods
}
Option configures the server.
func WithShutdown ¶ added in v0.3.0
func WithShutdown(sd shutdown.ShutdownFunc) Option
type OptionFunc ¶ added in v0.3.0
type OptionFunc func(*Server)
OptionFunc wraps a func so it satisfies the Option interface.
type Server ¶
type Server struct {
Name string
HTTPServer *HTTPServer
GRPCServer *GRPCServer
// contains filtered or unexported fields
}
Server defines the structure of a server.
Click to show internal directories.
Click to hide internal directories.