Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HTTPListenAddress string `yaml:"http_listen_address"`
// HTTPListenPort specifies the port to listen on. If the port is 0, a port
// number is automatically chosen. The Addr method of Server can be used to
// discover the chosen port. The value in Config will not be updated.
HTTPListenPort int `yaml:"http_listen_port"`
HTTPConnLimit int `yaml:"http_conn_limit"`
ServerGracefulShutdownTimeout time.Duration `yaml:"server_graceful_shutdown_timeout"`
HTTPServerReadTimeout time.Duration `yaml:"http_server_read_timeout"`
HTTPServerWriteTimeout time.Duration `yaml:"http_server_write_timeout"`
HTTPServerIdleTimeout time.Duration `yaml:"http_server_idle_timeout"`
HTTPMaxRequestSizeLimit int64 `yaml:"http_max_request_size_limit"`
GRPCListenPort int `yaml:"grpc_listen_port"`
PathPrefix string `yaml:"path_prefix"`
}
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
type Server ¶
type Server struct {
Router *mux.Router
HTTPServer *http.Server
GRPCServer *grpc.Server
// contains filtered or unexported fields
}
Server initializes an Router webserver as well as the desired middleware configuration
func NewServer ¶
func NewServer(log log.Logger, cfg Config, router *mux.Router, middlewares []middleware.Interface) (*Server, error)
NewServer initializes an httpserver with a router and all the configuration parameters given. Note that all the provided middlewares are wrapped in order.
Click to show internal directories.
Click to hide internal directories.