Documentation ¶
Index ¶
- func ExtractRESTRequest(c *Context, methods map[string]*Method) (*Request, *Response)
- type Context
- func (c *Context) Acknowledge() services.Response
- func (c *Context) Error(code int, message string, data interface{}) services.Response
- func (c *Context) InternalError() services.Response
- func (c *Context) InvalidParams(err error) services.Response
- func (c *Context) IsInternalError(resp services.Response) bool
- func (c *Context) MethodNotFound() services.Response
- func (c *Context) Nil() services.Response
- func (c *Context) NotFound() services.Response
- func (c *Context) Params() map[string]interface{}
- func (c *Context) Result(data interface{}) services.Response
- type Error
- type Handler
- type Method
- type RESTServer
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
func (*Context) Acknowledge ¶
func (c *Context) Acknowledge() services.Response
func (*Context) InternalError ¶
func (c *Context) InternalError() services.Response
func (*Context) InvalidParams ¶
func (*Context) IsInternalError ¶
func (*Context) MethodNotFound ¶
func (c *Context) MethodNotFound() services.Response
type Error ¶
type Error struct { Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
type Method ¶
type RESTServer ¶
type RESTServer struct {
// contains filtered or unexported fields
}
func MakeRESTServer ¶
func MakeRESTServer(settings *services.RESTServerSettings, handler Handler, metricsPrefix string, httpServer *http.HTTPServer) (*RESTServer, error)
func (*RESTServer) Start ¶
func (s *RESTServer) Start() error
func (*RESTServer) Stop ¶
func (s *RESTServer) Stop() error
Click to show internal directories.
Click to hide internal directories.