Documentation ¶
Index ¶
- Constants
- type App
- func (app *App) AddBGJob(name string, fn func(context.Context, chan<- Message)) error
- func (app *App) AddClearFn(fn func())
- func (a *App) AddMetaData(key string, value string)
- func (a *App) Env() string
- func (app *App) FireAnonymousJob(fn func(context.Context))
- func (app *App) GetBGChan(name string) <-chan Message
- func (app *App) GetBGJobParam(name string) *JobParam
- func (a *App) GetMetaData(key string) string
- func (app *App) Serve(ctx context.Context, routes http.Handler) error
- func (app *App) ServeTLS(ctx context.Context, routes http.Handler, cert, pKey string) error
- func (app *App) Shutdown()
- type Config
- type JobParam
- type Message
Constants ¶
View Source
const ( DevEnv = "development" DevPort = 8080 )
DevEnv const
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.0.4
App is the main application object.
func DefaultApp ¶ added in v0.0.5
func DefaultApp() *App
DefaultApp is the default application object.
func (*App) AddClearFn ¶ added in v0.3.7
func (app *App) AddClearFn(fn func())
AddClearFn add defer func in app.shutdown you may add db.close, redis.close, etc not goroutine safe
func (*App) AddMetaData ¶ added in v0.0.7
AddMetaData adds meta data to the application by key.
func (*App) FireAnonymousJob ¶ added in v0.4.24
FireAnonymousJob start a background job, goroutine safe
func (*App) GetBGChan ¶ added in v0.3.5
GetBGChan get backgroud job receive only feedback chan goroutine safe
func (*App) GetBGJobParam ¶ added in v0.4.1
GetBGJobParam get backgroud job param goroutine safe
func (*App) GetMetaData ¶ added in v0.0.7
GetMetaData returns the meta data of the application by key.
type Config ¶
Config is the configuration for the application
func DefaultConfig ¶ added in v0.0.5
func DefaultConfig() *Config
DefaultConfig is the default configuration for the application
type JobParam ¶ added in v0.4.0
type JobParam struct { Chan chan Message Cancle context.CancelFunc }
JobParam ...
Click to show internal directories.
Click to hide internal directories.