Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEncodedConn ¶
Types ¶
type Config ¶ added in v0.6.0
type Config struct { ClientId string `json:"client_id" yaml:"client_id"` ClusterId string `json:"clusterId" yaml:"cluster_id"` BrokerId string `json:"brokerId" yaml:"broker_id"` Broker string `json:"brokers" yaml:"broker"` User string `json:"user" yaml:"user"` Password string `json:"password" yaml:"password"` Token string `json:"token" yaml:"token"` Channels map[string]string `json:"channels" yaml:"channels"` AckTimeout int64 `json:"ack_timeout" yaml:"ack_timeout"` TLS SSL `json:"tls" yaml:"tls"` NatsConn []nats.Option `json:"-" yaml:"-"` StanConn []stan.Option `json:"-" yaml:"-"` Logger *zap.SugaredLogger `json:"-" yaml:"-"` Tracer opentracing.Tracer `json:"-" yaml:"-"` }
Config represent stan.Conn and nats.Conn connection parameters
func (*Config) GetNatsUserInfo ¶ added in v0.6.0
func (c *Config) GetNatsUserInfo() nats.Option
type MessageInfo ¶ added in v0.9.0
type NatsSub ¶
type NatsSub struct {
// contains filtered or unexported fields
}
func NewSubscription ¶
func NewSubscription(c *NatsSubOpts) (*NatsSub, error)
func (*NatsSub) StartConsumption ¶
func (ns *NatsSub) StartConsumption(ctx context.Context, handler NatsSubHandler)
type NatsSubHandler ¶ added in v0.7.0
type NatsSubOpts ¶ added in v0.8.0
type SSL ¶ added in v0.6.0
type SSL struct { Enabled bool `json:"enabled" yaml:"enabled"` CaPath string `json:"ca" yaml:"ca"` KeyPath string `json:"key" yaml:"key"` CertPath string `json:"cert" yaml:"cert"` Verify bool `json:"verify" yaml:"verify"` AuthType string `json:"auth_type" yaml:"auth_type"` }
SSL contains tls connection options
type StanConn ¶
type StanConn struct {
// contains filtered or unexported fields
}
func NewStanConn ¶
func (*StanConn) DefaultAckHandler ¶ added in v0.1.5
func (*StanConn) SendAsyncMessage ¶
func (*StanConn) SendMessage ¶
type StanSub ¶
type StanSub struct {
// contains filtered or unexported fields
}
func NewChanSub ¶
func NewChanSub(c *StanSubOpts) (*StanSub, error)
NewChanSub creates connection with channel-named clientID creating subscription with a whole service lifetime context
func (*StanSub) StartConsumption ¶
func (ns *StanSub) StartConsumption(ctx context.Context, handler StanSubHandler)
type StanSubHandler ¶ added in v0.7.0
type StanSubHandler func(ctx context.Context, data []byte, info *MessageInfo) error
type StanSubOpts ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.