Documentation ¶
Overview ¶
Package nats_protobuf is a generated protocol buffer package.
It is generated from these files:
messages.proto
It has these top-level messages:
Message
Index ¶
- func NewProxy(nc *nats.Conn, subject string, mapper Mapper, filters ...Filter) http.Handler
- type Filter
- type HandlerFunc
- type Mapper
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetError() string
- func (m *Message) GetHeaders() map[string]string
- func (m *Message) GetMeta() map[string]string
- func (m *Message) GetMethod() string
- func (m *Message) GetPayload() []byte
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
type Filter func(requestFunc HandlerFunc) HandlerFunc
Filter defines the shape of the middleware. Both ```Subscribe``` and ```New*``` accept an optional list of middlewares that will be applied in FIFO order
func PublishOnly ¶
PublishOnly sends the message using nats.Publish rather than nats.Request allowing for multiple receivers. Note that when using PublishOnly, the response object will always be nil.
type HandlerFunc ¶
HandlerFunc provides an abstraction over the call to nats. Useful for defining middleware.
func NewPublishFunc ¶
func NewPublishFunc(nc *nats.Conn, subject string) HandlerFunc
NewPublishFunc generates a new HandlerFunc that uses nats.Publish
func NewRequestFunc ¶
func NewRequestFunc(nc *nats.Conn, subject string) HandlerFunc
NewRequestFunc generates a new HandlerFunc that uses nats.Request
type Mapper ¶
Mapper accepts the name of a function and returns a new instance of it's input and output types or false if the name provided was not recognized
type Message ¶
type Message struct { Method string `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"` Headers map[string]string `` /* 134-byte string literal not displayed */ Meta map[string]string `` /* 128-byte string literal not displayed */ Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` Error string `protobuf:"bytes,5,opt,name=error" json:"error,omitempty"` }
func (*Message) Descriptor ¶
func (*Message) GetHeaders ¶
func (*Message) GetPayload ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package examples is a generated protocol buffer package.
|
Package examples is a generated protocol buffer package. |
customname
Package main is a generated protocol buffer package.
|
Package main is a generated protocol buffer package. |