Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MessagingClient ¶
type MessagingClient interface { Publish(msg *messaging.Msg) error Consume(topic string, groupID string, handler func(msg *messaging.Msg) error) error IsLocalConsume(topic string, key string) (bool, error) }
MessagingClient represents messaging client such as kafka
type RPCdata ¶
type RPCdata struct { Name string // name of the function Args []interface{} // request's or response's body expect error. Err string // Error any executing remote server }
RPCdata represents the serializing format of structured data
type RequestReplyClient ¶
type RequestReplyClient struct {
// contains filtered or unexported fields
}
RequestReplyClient represents client instance
func NewRequestReplyClient ¶
func NewRequestReplyClient(topic string, client MessagingClient, config *RequestReplyConfig) *RequestReplyClient
NewRequestReplyClient creates new request reply client instance
func (*RequestReplyClient) Request ¶
func (c *RequestReplyClient) Request(key string, payload []byte) ([]byte, error)
Request sends a request with payload and wait for a response. key is used as a partition key.
func (*RequestReplyClient) SubscribeRequest ¶
func (c *RequestReplyClient) SubscribeRequest(handler func(payload []byte) ([]byte, error)) error
SubscribeRequest waits for a request to come in and call the handler func
type RequestReplyConfig ¶
RequestReplyConfig represents request reply configuration
Click to show internal directories.
Click to hide internal directories.