Documentation ¶
Index ¶
- func AllowAllCorsMiddleware(h http.Handler) http.Handler
- type AppHandler
- type AppHandlerWithUserID
- type ConfigureRouterHandler
- type GelfFormatter
- type ServerStatus
- type SimpleService
- type SimpleServiceBase
- type SimpleServiceBeforeEnd
- type SimpleServiceBeforeStart
- type SimpleServiceGetHTTPHandlerObsolete
- type SimpleServiceGetStatusHandler
- type SimpleServiceObject
- type SimpleServicePreparePFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppHandler ¶
type AppHandler func(w http.ResponseWriter, r *http.Request) error
AppHandler is handler that take care of content type and error handling
func (AppHandler) ServeHTTP ¶
func (ah AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Satisfies the http.Handler interface
type AppHandlerWithUserID ¶
AppHandlerWithUserID is handler that take care of userID, content type and error handling
func (AppHandlerWithUserID) ServeHTTP ¶
func (ah AppHandlerWithUserID) ServeHTTP(w http.ResponseWriter, r *http.Request)
Satisfies the http.Handler interface
type ConfigureRouterHandler ¶ added in v0.4.0
type ConfigureRouterHandler interface {
ConfigureRouter(router *mux.Router) (handler http.Handler, err error)
}
ConfigureRouterHandler ...
type GelfFormatter ¶
type GelfFormatter struct {
// contains filtered or unexported fields
}
GelfFormatter ...
type ServerStatus ¶
type ServerStatus struct { Running bool `json:"running"` Process string `json:"process"` Pid int `json:"pid"` StripPath string `json:"strip_path"` }
ServerStatus return actual state and process data so you can test with url/state the correct installation of microservice
func NewServerStatus ¶
func NewServerStatus() *ServerStatus
NewServerStatus create default service status
type SimpleService ¶
type SimpleService interface { Start() (err error) // Start service SetTimeouts(writeTimeout time.Duration, readTimeout time.Duration, idleTimeout time.Duration) // set timeouts. 0 will use default values. It must be called before start }
SimpleService ...
func NewSimpleService ¶
func NewSimpleService(obj SimpleServiceObject) SimpleService
NewSimpleService creates new simple service object
type SimpleServiceBase ¶
type SimpleServiceBase struct {
// contains filtered or unexported fields
}
SimpleServiceBase ...
func (*SimpleServiceBase) SetTimeouts ¶ added in v0.2.1
func (*SimpleServiceBase) Start ¶
func (s *SimpleServiceBase) Start() (err error)
Start starts service
type SimpleServiceBeforeEnd ¶ added in v0.2.2
type SimpleServiceBeforeEnd interface {
BeforeEnd()
}
SimpleServiceBeforeEnd ...
type SimpleServiceBeforeStart ¶
type SimpleServiceBeforeStart interface {
BeforeStart() (err error)
}
SimpleServiceBeforeStart ...
type SimpleServiceGetHTTPHandlerObsolete ¶ added in v0.4.0
type SimpleServiceGetHTTPHandlerObsolete interface {
GetHTTPHandler() (handler http.Handler, err error)
}
SimpleServiceGetHTTPHandlerObsolete ...
type SimpleServiceGetStatusHandler ¶ added in v0.4.0
type SimpleServiceGetStatusHandler interface {
GetServerStatus() (status interface{})
}
SimpleServiceGetStatusHandler ...
type SimpleServicePreparePFlags ¶
type SimpleServicePreparePFlags interface {
PreparePFlags() (err error)
}
SimpleServicePreparePFlags ...