Documentation
¶
Index ¶
- Variables
- func AddFilter(f Filter)
- func AddFilterExecutor(fe FilterExecutor)
- func AddService(s Service)
- func Init(service web.Service, z Initializer) error
- type Dispatcher
- func (d *Dispatcher) AddError(e *eerr.Error)
- func (d *Dispatcher) AddResult(key, value string)
- func (d *Dispatcher) Dispatch(e *event.Event)
- func (d *Dispatcher) Error(index int) *eerr.Error
- func (d *Dispatcher) HasError() bool
- func (d *Dispatcher) Result(key string) string
- func (d *Dispatcher) Results() map[string]string
- type Filter
- type FilterExecutor
- type Initializer
- type Route
- type RouteHandler
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MethodGet GET MethodGet = "GET" // MethodPost POST MethodPost = "POST" // MethodPut PUT MethodPut = "PUT" // MethodPatch PATCH MethodPatch = "PATCH" // MethodDelete DELETE MethodDelete = "DELETE" // MethodHead HEAD MethodHead = "HEAD" // MethodOptions OPTIONS MethodOptions = "OPTIONS" )
View Source
var ( // ErrBadName bad API service name ErrBadName = errors.New("Bad API service name") )
Functions ¶
func AddFilterExecutor ¶
func AddFilterExecutor(fe FilterExecutor)
AddFilterExecutor add filter executor directly
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher for API
func (*Dispatcher) AddResult ¶
func (d *Dispatcher) AddResult(key, value string)
AddResult add result
func (*Dispatcher) Error ¶
func (d *Dispatcher) Error(index int) *eerr.Error
Error get single error by index
func (*Dispatcher) Result ¶
func (d *Dispatcher) Result(key string) string
Result get result with key
func (*Dispatcher) Results ¶
func (d *Dispatcher) Results() map[string]string
Results get all results
type FilterExecutor ¶
FilterExecutor filter handler function
type Initializer ¶
type Initializer interface { // InitFilters set go-restful filters InitFilters() // InitServices set services InitServices() }
Initializer of API server
type Route ¶
type Route struct { Method string Path string Input interface{} Handler RouteHandler }
Route config element
type RouteHandler ¶
RouteHandler route handler function
Click to show internal directories.
Click to hide internal directories.