Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaulPostResponseFn ¶
func DefaulPostResponseFn(ctx context.Context, method string, response apachethrift.TStruct)
DefaulPostResponseFn will close M3DB contexts per request
func RegisterHandlers ¶
func RegisterHandlers(mux *http.ServeMux, service interface{}, opts ServerOptions) error
RegisterHandlers will register handlers on the HTTP serve mux for a given service and options
Types ¶
type ContextFn ¶
ContextFn is a function that sets the context for all service methods derived from the incoming request context
func NewDefaultContextFn ¶
func NewDefaultContextFn(contextPool m3dbcontext.Pool) ContextFn
NewDefaultContextFn returns a function that will create M3DB contexts per request
type PostResponseFn ¶
type PostResponseFn func(ctx context.Context, method string, response apachethrift.TStruct)
PostResponseFn is a function that is called at the end of a request
type ServerOptions ¶
type ServerOptions interface {
// SetReadTimeout sets the read timeout and returns a new ServerOptions
SetReadTimeout(value time.Duration) ServerOptions
// ReadTimeout returns the read timeout
ReadTimeout() time.Duration
// SetWriteTimeout sets the write timeout and returns a new ServerOptions
SetWriteTimeout(value time.Duration) ServerOptions
// WriteTimeout returns the write timeout
WriteTimeout() time.Duration
// SetRequestTimeout sets the request timeout and returns a new ServerOptions
SetRequestTimeout(value time.Duration) ServerOptions
// RequestTimeout returns the request timeout
RequestTimeout() time.Duration
// SetContextFn sets the context fn and returns a new ServerOptions
SetContextFn(value ContextFn) ServerOptions
// ContextFn returns the context fn
ContextFn() ContextFn
// SetPostResponseFn sets the post response fn and returns a new ServerOptions
SetPostResponseFn(value PostResponseFn) ServerOptions
// PostResponseFn returns the post response fn
PostResponseFn() PostResponseFn
}
ServerOptions is a set of server options
func NewServerOptions ¶
func NewServerOptions() ServerOptions
NewServerOptions creates a new set of server options with defaults
Click to show internal directories.
Click to hide internal directories.