Documentation ¶
Index ¶
- func NewApiError(sm string, cm interface{}, code int) error
- func WriteError(err error, r *restful.Response)
- type ApiError
- type Application
- type AsyncJob
- type AsyncWorker
- type Controller
- func (ct *Controller) AddJob(n string, j *AsyncJob) error
- func (ct *Controller) GetConfig(req *restful.Request) *toml.Tree
- func (ct *Controller) GetPlugin(name string, req *restful.Request) interface{}
- func (ct *Controller) NewJobQueue(n string, w AsyncWorker, c int) error
- func (ct *Controller) Register(container *restful.Container)
- type JobParams
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewApiError ¶
func WriteError ¶
func WriteError(err error, r *restful.Response)
Types ¶
type Application ¶
type Application struct { Config *toml.Tree Container *restful.Container // contains filtered or unexported fields }
func (*Application) Init ¶
func (a *Application) Init(filename string)
func (*Application) Plugins ¶
func (a *Application) Plugins(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
Make plugins available to controllers with this middleware
func (*Application) RegisterPlugin ¶
func (a *Application) RegisterPlugin(n string, p Plugin)
func (*Application) Start ¶
func (a *Application) Start()
type AsyncJob ¶
type AsyncJob struct { Result chan interface{} // contains filtered or unexported fields }
func NewAsyncJob ¶
func NewAsyncJob(c chan interface{}) *AsyncJob
type AsyncWorker ¶
type AsyncWorker func(p JobParams) interface{}
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) GetConfig ¶
func (ct *Controller) GetConfig(req *restful.Request) *toml.Tree
func (*Controller) GetPlugin ¶
func (ct *Controller) GetPlugin(name string, req *restful.Request) interface{}
func (*Controller) NewJobQueue ¶
func (ct *Controller) NewJobQueue(n string, w AsyncWorker, c int) error
func (*Controller) Register ¶
func (ct *Controller) Register(container *restful.Container)
type Plugin ¶
type Plugin interface { Init(a *Application) error Close() error Get() interface{} }
Click to show internal directories.
Click to hide internal directories.