Documentation ¶
Index ¶
- type Server
- type ServerOption
- func WithGQLHandler(h http.Handler) ServerOption
- func WithGracefulShutdownTimeout(d time.Duration) ServerOption
- func WithIdleTimeout(d time.Duration) ServerOption
- func WithPort(port int) ServerOption
- func WithProfilingHandler() ServerOption
- func WithRESTHandler(rtr func(chi.Router)) ServerOption
- func WithReadTimeout(d time.Duration) ServerOption
- func WithReadinessHandler(h http.HandlerFunc) ServerOption
- func WithWriteTimeout(d time.Duration) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the server instance.
type ServerOption ¶
ServerOption customizes the Server.
func WithGQLHandler ¶
func WithGQLHandler(h http.Handler) ServerOption
WithGQLHandler sets the GQL handler at `/graph` route.
func WithGracefulShutdownTimeout ¶
func WithGracefulShutdownTimeout(d time.Duration) ServerOption
WithGracefulShutdownTimeout overrides the default graceful shutdown timeout with the given value.
func WithIdleTimeout ¶
func WithIdleTimeout(d time.Duration) ServerOption
WithIdleTimeout overrides the default idle timeout with the given value.
func WithPort ¶
func WithPort(port int) ServerOption
WithPort overrides the default server port with the given value.
func WithProfilingHandler ¶
func WithProfilingHandler() ServerOption
WithProfilingHandler enables go's pprof profiling.
func WithRESTHandler ¶
func WithRESTHandler(rtr func(chi.Router)) ServerOption
WithRESTHandler sets the REST route handler.
func WithReadTimeout ¶
func WithReadTimeout(d time.Duration) ServerOption
WithReadTimeout overrides the default read timeout with the given value.
func WithReadinessHandler ¶
func WithReadinessHandler(h http.HandlerFunc) ServerOption
WithReadinessHandler sets the handler for readiness checks at `/_/ready`.
func WithWriteTimeout ¶
func WithWriteTimeout(d time.Duration) ServerOption
WithWriteTimeout overrides the default write timeout with the given value.