Documentation ¶
Overview ¶
Package joehttp contains an HTTP server integrations for the Joe bot library https://github.com/go-joe/joe
Index ¶
- func Server(path string, opts ...Option) joe.Module
- type Option
- func WithLogger(logger *zap.Logger) Option
- func WithReadTimeout(d time.Duration) Option
- func WithTLS(certFile, keyFile string) Option
- func WithTLSConfig(tlsConf *tls.Config) Option
- func WithTimeouts(d time.Duration) Option
- func WithTrustedHeader(header string) Option
- func WithWriteTimeout(d time.Duration) Option
- type RequestEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶ added in v0.4.0
type Option func(*config) error
An Option is used to configure the HTTP server.
func WithLogger ¶ added in v0.4.0
WithLogger can be used to inject a different logger for the HTTP server.
func WithReadTimeout ¶ added in v0.4.0
WithReadTimeout sets the servers maximum duration for reading the entire HTTP request, including the body.
func WithTLSConfig ¶ added in v0.4.0
WithTLSConfig can be used in combination with the WithTLS(…) option to configure the HTTPS server.
func WithTimeouts ¶ added in v0.4.0
WithTimeouts sets both the read and write timeout of the HTTP server to the same given value.
func WithTrustedHeader ¶ added in v0.5.0
WithTrustedHeader sets the name of the header from which client IPs will be populated.
func WithWriteTimeout ¶ added in v0.4.0
WithWriteTimeout sets the servers maximum duration before timing out writes of the HTTP response.