Documentation ¶
Index ¶
- func JSONError(w http.ResponseWriter, msg string, code int)
- func JSONResponse(w http.ResponseWriter, data interface{}, code int)
- func LivenessHandler(hooks ...func() error) func(w http.ResponseWriter, r *http.Request)
- func LogMiddleware(next http.Handler) http.Handler
- func NewAuthMiddleware(getAuthTokens func() ([]*AuthToken, error)) func(http.Handler) http.Handler
- func NewLogger() zerolog.Logger
- func NewRouter() *chi.Mux
- func ReadinessHandler(hooks ...func() error) func(w http.ResponseWriter, r *http.Request)
- type App
- type AppConfig
- type AuthToken
- type Event
- type EventBus
- type EventBusConfig
- type EventBusHandler
- type HealthCheck
- type HealthCheckConfig
- type State
- type Task
- type TaskConfig
- type WebApp
- type WebAppConfig
- type Worker
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, data interface{}, code int)
func LivenessHandler ¶
func LivenessHandler(hooks ...func() error) func(w http.ResponseWriter, r *http.Request)
func NewAuthMiddleware ¶ added in v0.2.0
func ReadinessHandler ¶
func ReadinessHandler(hooks ...func() error) func(w http.ResponseWriter, r *http.Request)
Types ¶
type EventBus ¶ added in v0.2.0
type EventBus struct {
*EventBusConfig
}
func NewEventBus ¶ added in v0.2.0
func NewEventBus(config *EventBusConfig) *EventBus
func (*EventBus) Subscribe ¶ added in v0.2.0
func (eb *EventBus) Subscribe(eventType string, handler EventBusHandler)
func (*EventBus) Unsubscribe ¶ added in v0.2.0
func (eb *EventBus) Unsubscribe(eventType string, handler EventBusHandler)
type EventBusConfig ¶ added in v0.2.0
type EventBusConfig struct { Subscribers map[string][]EventBusHandler Shutdown chan bool // contains filtered or unexported fields }
type EventBusHandler ¶ added in v0.2.0
type HealthCheck ¶
type HealthCheck struct {
*HealthCheckConfig
}
func NewHealthCheck ¶
func NewHealthCheck(config *HealthCheckConfig) *HealthCheck
type HealthCheckConfig ¶
type State ¶ added in v0.2.0
type State struct { Data map[string]interface{} // contains filtered or unexported fields }
type Task ¶ added in v0.2.0
type Task struct {
*TaskConfig
}
func NewTask ¶ added in v0.2.0
func NewTask(config *TaskConfig) *Task
type TaskConfig ¶ added in v0.2.0
type WebApp ¶ added in v0.2.0
type WebApp struct {
*WebAppConfig
}
func NewWebApp ¶ added in v0.2.0
func NewWebApp(config *WebAppConfig) *WebApp
type WebAppConfig ¶ added in v0.2.0
type WebAppConfig struct { Port string Router *chi.Mux }
type Worker ¶ added in v0.2.0
type Worker struct {
*WorkerConfig
}
func NewWorker ¶ added in v0.2.0
func NewWorker(config *WorkerConfig) *Worker
func (*Worker) RemoveTask ¶ added in v0.2.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
web_app
Module
|
|
worker_run_forever_task
Module
|
|
worker_run_once_task
Module
|
|
Click to show internal directories.
Click to hide internal directories.