Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNewConnectionToNats ¶
func CreateNewConnectionToNats(preference *NatsConnectionConfiguration) (*nats.Conn, error)
CreateNewConnectionToNats - initialize new connection to nats
Types ¶
type ISubscriber ¶
type ISubscriber interface {
Subscribe() error
}
type NatsConnectionConfiguration ¶
type NatsConnectionConfiguration struct { URL string `cf_env:"NATS_URL" cf_default:"nats://localhost:4222"` NameClient string `cf_env:"NATS_NAME" cf_default:"bomber"` MaxWait int `cf_env:"NATS_MAX_WAIT" cf_default:"1"` ReconnectDelay int64 `cf_env:"NATS_RECONNECT_DELAY" cf_default:"2"` CurrentServiceID string `cf_env:"BOMBER_ID" cf_default:"15123kjnsjhad"` LogLevel string `cf_env:"LOG_LEVEL" cf_default:"error"` }
func ParseConfiguration ¶
func ParseConfiguration() (*NatsConnectionConfiguration, error)
func (*NatsConnectionConfiguration) CorrectedGeneratingHandlerName ¶
func (config *NatsConnectionConfiguration) CorrectedGeneratingHandlerName()
type Publisher ¶
type Publisher struct {
Connection *nats.Conn
}
func NewPublisher ¶
func NewPublisher(connection *nats.Conn) *Publisher
type Subscriber ¶
type Subscriber struct { Connection *nats.Conn // contains filtered or unexported fields }
func NewSubscriber ¶
func NewSubscriber(connection *nats.Conn, topicName string) *Subscriber
func (*Subscriber) Subscribe ¶
func (subscr *Subscriber) Subscribe(handler nats.MsgHandler) error
Click to show internal directories.
Click to hide internal directories.