Documentation ¶
Index ¶
- Variables
- type Client
- type Handler
- type Request
- func (r *Request) AddTags(tags ...string)
- func (r *Request) Context() context.Context
- func (r *Request) Error(code error, message error) error
- func (r *Request) Original() *nats.Msg
- func (r *Request) Publish(sub string, b []byte) error
- func (r *Request) RemoveTags(tags ...string)
- func (r *Request) RemoveTagsByPrefix(tags ...string)
- func (r *Request) Respond(data interface{}) error
- func (r *Request) UnmarshalBody(dest interface{}) error
- type RequestPool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMarshalError = errors.New("MARSHAL_ERROR") ErrUnmarshalError = errors.New("UNMARSHAL_ERROR") ErrNotConnected = errors.New("not connected to nats") ErrHostIsNotDefined = errors.New("NATS_HOST environment is required") TotalWait time.Duration = 3 * time.Minute ReconnectDelay time.Duration = 10 * time.Second )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Handler ¶
Handle adds the route `pattern` that matches any method to execute the `handler` Handler.
type Request ¶
func NewRequest ¶
func NewRequest() *Request
func (*Request) RemoveTags ¶
send a message to gateway on session.tag, and RemoveTags in body
func (*Request) RemoveTagsByPrefix ¶ added in v0.3.7
send a message to gateway on session.tag, and RemoveByPrefix in body
func (*Request) UnmarshalBody ¶ added in v0.3.4
allows to unmarshal body to provided structure
type RequestPool ¶
func NewResponsePool ¶
func NewResponsePool() RequestPool
func (*RequestPool) GetResponse ¶
func (r *RequestPool) GetResponse() *Request
func (*RequestPool) PutResponse ¶
func (r *RequestPool) PutResponse(res *Request)
Click to show internal directories.
Click to hide internal directories.