Documentation ¶
Index ¶
- Constants
- type Config
- type Endpoint
- type RequestMessage
- func (r *RequestMessage) Body() []byte
- func (r RequestMessage) From() string
- func (r *RequestMessage) GetError() error
- func (r *RequestMessage) GetMsg() *types.RuleMsg
- func (r *RequestMessage) GetParam(key string) string
- func (r *RequestMessage) Headers() textproto.MIMEHeader
- func (r *RequestMessage) Request() *http.Request
- func (r *RequestMessage) SetBody(body []byte)
- func (r *RequestMessage) SetError(err error)
- func (r *RequestMessage) SetMsg(msg *types.RuleMsg)
- func (r *RequestMessage) SetStatusCode(statusCode int)
- type ResponseMessage
- func (r *ResponseMessage) Body() []byte
- func (r *ResponseMessage) From() string
- func (r *ResponseMessage) GetError() error
- func (r *ResponseMessage) GetMsg() *types.RuleMsg
- func (r *ResponseMessage) GetParam(key string) string
- func (r *ResponseMessage) Headers() textproto.MIMEHeader
- func (r *ResponseMessage) Response() http.ResponseWriter
- func (r *ResponseMessage) SetBody(body []byte)
- func (r *ResponseMessage) SetError(err error)
- func (r *ResponseMessage) SetMsg(msg *types.RuleMsg)
- func (r *ResponseMessage) SetStatusCode(statusCode int)
- type Rest
- func (rest *Rest) AddRouter(router *endpoint.Router, params ...interface{}) (string, error)
- func (rest *Rest) Close() error
- func (rest *Rest) DELETE(routers ...*endpoint.Router) *Rest
- func (rest *Rest) Destroy()
- func (rest *Rest) GET(routers ...*endpoint.Router) *Rest
- func (rest *Rest) GlobalOPTIONS(handler http.Handler) *Rest
- func (rest *Rest) HEAD(routers ...*endpoint.Router) *Rest
- func (rest *Rest) Id() string
- func (rest *Rest) Init(ruleConfig types.Config, configuration types.Configuration) error
- func (rest *Rest) New() types.Node
- func (rest *Rest) OPTIONS(routers ...*endpoint.Router) *Rest
- func (rest *Rest) PATCH(routers ...*endpoint.Router) *Rest
- func (rest *Rest) POST(routers ...*endpoint.Router) *Rest
- func (rest *Rest) PUT(routers ...*endpoint.Router) *Rest
- func (rest *Rest) Printf(format string, v ...interface{})
- func (rest *Rest) RemoveRouter(routerId string, params ...interface{}) error
- func (rest *Rest) Router() *httprouter.Router
- func (rest *Rest) Start() error
- func (rest *Rest) Type() string
Constants ¶
View Source
const ( ContentTypeKey = "Content-Type" JsonContextType = "application/json" )
View Source
const Type = "http"
Type 组件类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestMessage ¶
type RequestMessage struct { //路径参数 Params httprouter.Params // contains filtered or unexported fields }
RequestMessage http请求消息
func (*RequestMessage) Body ¶
func (r *RequestMessage) Body() []byte
func (RequestMessage) From ¶
func (r RequestMessage) From() string
func (*RequestMessage) GetError ¶ added in v0.15.0
func (r *RequestMessage) GetError() error
func (*RequestMessage) GetMsg ¶
func (r *RequestMessage) GetMsg() *types.RuleMsg
func (*RequestMessage) GetParam ¶
func (r *RequestMessage) GetParam(key string) string
func (*RequestMessage) Headers ¶
func (r *RequestMessage) Headers() textproto.MIMEHeader
func (*RequestMessage) Request ¶
func (r *RequestMessage) Request() *http.Request
func (*RequestMessage) SetBody ¶
func (r *RequestMessage) SetBody(body []byte)
func (*RequestMessage) SetError ¶ added in v0.15.0
func (r *RequestMessage) SetError(err error)
func (*RequestMessage) SetMsg ¶
func (r *RequestMessage) SetMsg(msg *types.RuleMsg)
func (*RequestMessage) SetStatusCode ¶
func (r *RequestMessage) SetStatusCode(statusCode int)
type ResponseMessage ¶
type ResponseMessage struct {
// contains filtered or unexported fields
}
ResponseMessage http响应消息
func (*ResponseMessage) Body ¶
func (r *ResponseMessage) Body() []byte
func (*ResponseMessage) From ¶
func (r *ResponseMessage) From() string
func (*ResponseMessage) GetError ¶ added in v0.15.0
func (r *ResponseMessage) GetError() error
func (*ResponseMessage) GetMsg ¶
func (r *ResponseMessage) GetMsg() *types.RuleMsg
func (*ResponseMessage) GetParam ¶
func (r *ResponseMessage) GetParam(key string) string
func (*ResponseMessage) Headers ¶
func (r *ResponseMessage) Headers() textproto.MIMEHeader
func (*ResponseMessage) Response ¶
func (r *ResponseMessage) Response() http.ResponseWriter
func (*ResponseMessage) SetBody ¶
func (r *ResponseMessage) SetBody(body []byte)
func (*ResponseMessage) SetError ¶ added in v0.15.0
func (r *ResponseMessage) SetError(err error)
func (*ResponseMessage) SetMsg ¶
func (r *ResponseMessage) SetMsg(msg *types.RuleMsg)
func (*ResponseMessage) SetStatusCode ¶
func (r *ResponseMessage) SetStatusCode(statusCode int)
type Rest ¶
type Rest struct { endpoint.BaseEndpoint //配置 Config Config RuleConfig types.Config Server *http.Server //事件回调函数 OnEventFunc endpoint.OnEvent // contains filtered or unexported fields }
Rest 接收端端点
func (*Rest) GlobalOPTIONS ¶ added in v0.16.0
func (*Rest) RemoveRouter ¶ added in v0.17.0
func (*Rest) Router ¶
func (rest *Rest) Router() *httprouter.Router
Click to show internal directories.
Click to hide internal directories.