system

package
v0.0.0-...-3af2afe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiError

func NewApiError(sm string, cm interface{}, code int) error

func WriteError

func WriteError(err error, r *restful.Response)

Types

type ApiError

type ApiError struct {
	SystemMessage string
	ClientMessage interface{}
	Code          int
}

func (ApiError) Error

func (e ApiError) Error() string

type Application

type Application struct {
	Config    *toml.TomlTree
	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

func (*AsyncJob) Get

func (a *AsyncJob) Get(k string) interface{}

func (*AsyncJob) Set

func (a *AsyncJob) Set(k string, v interface{})

type AsyncWorker

type AsyncWorker func(p JobParams) interface{}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func (*Controller) AddJob

func (ct *Controller) AddJob(n string, j *AsyncJob) error

func (*Controller) GetConfig

func (ct *Controller) GetConfig(req *restful.Request) *toml.TomlTree

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 JobParams

type JobParams map[string]interface{}

type Plugin

type Plugin interface {
	Init(a *Application) error
	Close() error
	Get() interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL