Documentation
¶
Index ¶
- Constants
- type Config
- type Endpoint
- type RabbitMQ
- func (x *RabbitMQ) AddRouter(router endpointApi.Router, params ...interface{}) (string, error)
- func (x *RabbitMQ) Close() error
- func (x *RabbitMQ) Destroy()
- func (x *RabbitMQ) GracefulStop()
- func (x *RabbitMQ) Id() string
- func (x *RabbitMQ) Init(ruleConfig types.Config, configuration types.Configuration) error
- func (x *RabbitMQ) New() types.Node
- func (x *RabbitMQ) Printf(format string, v ...interface{})
- func (x *RabbitMQ) RemoveRouter(routerId string, params ...interface{}) error
- func (x *RabbitMQ) Start() error
- func (x *RabbitMQ) Type() string
- 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) 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) SetBody(body []byte)
- func (r *ResponseMessage) SetError(err error)
- func (r *ResponseMessage) SetMsg(msg *types.RuleMsg)
- func (r *ResponseMessage) SetStatusCode(statusCode int)
Constants ¶
View Source
const ( Type = types.EndpointTypePrefix + "rabbitmq" KeyRequestTopic = "topic" KeyRequestKey = "key" KeyRequestExchange = "exchange" // KeyResponseExchange 响应交换机metadataKey KeyResponseExchange = "responseExchange" // KeyResponseTopic 响应主题metadataKey KeyResponseTopic = "responseTopic" // KeyResponseKey 响应主题metadataKey KeyResponseKey = "responseKey" JsonContextType = "application/json" )
View Source
const ( ContentTypeJson = "application/json" ContentTypeText = "text/plain" KeyContentType = "Content-Type" KeyUTF8 = "utf-8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RabbitMQ ¶
type RabbitMQ struct { impl.BaseEndpoint base.SharedNode[*amqp.Connection] // GracefulShutdown provides graceful shutdown capabilities // GracefulShutdown 提供优雅停机功能 base.GracefulShutdown RuleConfig types.Config Config Config // contains filtered or unexported fields }
func (*RabbitMQ) AddRouter ¶
func (x *RabbitMQ) AddRouter(router endpointApi.Router, params ...interface{}) (string, error)
func (*RabbitMQ) GracefulStop ¶ added in v0.32.0
func (x *RabbitMQ) GracefulStop()
GracefulStop provides graceful shutdown for the RabbitMQ endpoint GracefulStop 为 RabbitMQ 端点提供优雅停机
func (*RabbitMQ) RemoveRouter ¶
type RequestMessage ¶
type RequestMessage struct {
// contains filtered or unexported fields
}
func (*RequestMessage) Body ¶
func (r *RequestMessage) Body() []byte
func (*RequestMessage) From ¶
func (r *RequestMessage) From() string
func (*RequestMessage) GetError ¶
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) SetBody ¶
func (r *RequestMessage) SetBody(body []byte)
func (*RequestMessage) SetError ¶
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
}
func (*ResponseMessage) Body ¶
func (r *ResponseMessage) Body() []byte
func (*ResponseMessage) From ¶
func (r *ResponseMessage) From() string
func (*ResponseMessage) GetError ¶
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) SetBody ¶
func (r *ResponseMessage) SetBody(body []byte)
func (*ResponseMessage) SetError ¶
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)
Click to show internal directories.
Click to hide internal directories.