Documentation ¶
Index ¶
- func NewDefaultServer(config *Config, handler http.Handler) *http.Server
- type ApplyFunc
- type Builder
- func (b *Builder) Build(ctx context.Context) *Server
- func (b *Builder) WithConfig(config *Config) *Builder
- func (b *Builder) WithContext(ctx context.Context, cancel context.CancelFunc) *Builder
- func (b *Builder) WithCustomServer(server *http.Server) *Builder
- func (b *Builder) WithHandler(handler http.Handler) *Builder
- func (b *Builder) WithOptions(options ...Option) *Builder
- type Config
- type Option
- type Options
- type Server
- type WGFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplyFunc ¶
ApplyFunc is a function type that satisfies the options interface.
func SetBaseContext ¶
SetBaseContext sets the basecontext for the server and currently ignores the net.Listener
func SetTimeOuts ¶
SetTimeOuts sets the ReadTimeout, ReadHeaderTimeout, WriteTimeout, and IdleTimeout of the server from the provided config unset timeouts will default to 0 or No Timeout
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) WithConfig ¶
func (*Builder) WithContext ¶
func (*Builder) WithOptions ¶
type Config ¶
type Config struct { Addr string HealthCheckEndpoint string ReadTimeout time.Duration ReadHeaderTimeout time.Duration WriteTimeout time.Duration IdleTimeout time.Duration }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) StartAndWait ¶
func (*Server) WatchContext ¶
WatchContext watches the provided context. When the context is Done, it will begin to shutdown the server and give time for other processes to finish.
Click to show internal directories.
Click to hide internal directories.