Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MaxReconnectDefault - max reconnect try cnt. MaxReconnectDefault = -1 // infinity // ReconnectWaitDefault - reconnect w8 timeout default value. ReconnectWaitDefault = 5 * time.Second // ReconnectJitterDefault - reconnect w8 jitter timeout default value. ReconnectJitterDefault = time.Second * 1 // ReconnectJitterTLSDefault - reconnect w8 jitter TLS timeout default value. ReconnectJitterTLSDefault = time.Second * 2 )
Variables ¶
View Source
var DefaultDSN = []URL{nats.DefaultURL}
DefaultDSN - default nats url and port.
View Source
var ErrEmptyMsg = errors.New("empty msg. nats msg is nil")
ErrEmptyMsg - empty msg. nats msg is nil.
Functions ¶
func NewDefaultClient ¶
func NewDefaultClient() *client
NewDefaultClient empty default client. nolint golint
Types ¶
type Handler ¶
type Handler = func(*Msg, Serializable) Serializable
Handler - pure NATS Msg, request reply.
type PureNatsConnI ¶
type PureNatsConnI interface { RequestWithContext(ctx context.Context, subj string, data []byte) (*Msg, error) Subscribe(subj string, msgHandler MsgHandler) (*Subscription, error) QueueSubscribe(subj string, queueGroup string, msgHandler MsgHandler) (*Subscription, error) Drain() error Close() }
PureNatsConnI - pure nats conn interface.
type SimpleNatsClientI ¶
type SimpleNatsClientI interface { UseCustomLogger(logger.Logger) Ping(context.Context, Subj) (bool, error) PongHandler(Subj) (*Subscription, error) PongQueueHandler(Subj, QueueGroup) (*Subscription, error) Request(context.Context, Subj, Serializable, Serializable) error ReplyHandler(Subj, Serializable, Handler) (*Subscription, error) ReplyQueueHandler(Subj, QueueGroup, Serializable, Handler) (*Subscription, error) NatsConn() *Conn Close() error }
SimpleNatsClientI _ .
Click to show internal directories.
Click to hide internal directories.