Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultMiddleware = []alice.Constructor{ requestID.Handler(20), log.Handler, timeout.DefaultHandler, }
DefaultMiddleware is the default middleware used to create a service
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig interface { HTTPConfig }
APIConfig represents the configuration required for an API service
type Config ¶
type Config interface {
Namespace() string
}
Config represents the configuration required for a service
type DefaultAPIConfig ¶
type DefaultAPIConfig struct {
// contains filtered or unexported fields
}
DefaultAPIConfig is a default APIConfig implementation
func (DefaultAPIConfig) BindAddr ¶
func (c DefaultAPIConfig) BindAddr() string
BindAddr implements HTTPConfig.BindAddr
func (DefaultAPIConfig) CertFile ¶
func (c DefaultAPIConfig) CertFile() string
CertFile implements HTTPConfig.CertFile
func (DefaultAPIConfig) KeyFile ¶
func (c DefaultAPIConfig) KeyFile() string
KeyFile implements HTTPConfig.KeyFile
type DefaultWebConfig ¶
type DefaultWebConfig struct { SessionSecret string `env:"SESSION_SECRET" flag:"session-secret" flagDesc:"Session secret"` SessionName string `env:"SESSION_NAME" flag:"session-name" flagDesc:"Session name"` // contains filtered or unexported fields }
DefaultWebConfig is a default WebConfig implementation
func (DefaultWebConfig) BindAddr ¶
func (c DefaultWebConfig) BindAddr() string
BindAddr implements HTTPConfig.BindAddr
func (DefaultWebConfig) CertFile ¶
func (c DefaultWebConfig) CertFile() string
CertFile implements HTTPConfig.CertFile
func (DefaultWebConfig) KeyFile ¶
func (c DefaultWebConfig) KeyFile() string
KeyFile implements HTTPConfig.KeyFile
type HTTPConfig ¶
HTTPConfig represents the configuration required for a HTTP service
type Service ¶
type Service interface { Chain(handler ...alice.Constructor) Start() Router() *pat.Router }
Service represents a service
func HTTP ¶
func HTTP(config HTTPConfig) Service
HTTP returns a new HTTP service using the provided config
type WebConfig ¶
type WebConfig interface { HTTPConfig }
WebConfig represents the configuration required for a web service