Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NatsPublishClient ¶
type NatsPublishClient interface {
Publish(req *PublishRequest) error
}
type NatsPublishClientImpl ¶
type NatsPublishClientImpl struct {
// contains filtered or unexported fields
}
func NewNatsPublishClientImpl ¶
func NewNatsPublishClientImpl(logger *zap.SugaredLogger, pubSubClient *PubSubClient) *NatsPublishClientImpl
func (*NatsPublishClientImpl) Publish ¶
func (impl *NatsPublishClientImpl) Publish(req *PublishRequest) error
TODO : adhiran : check the req.topic. We dont have dynamic topics listed in stream subjects arrary.So this might fail in subscription if the subject name passed is not listed
type PubSubClient ¶
type PubSubClient struct { JetStrCtxt nats.JetStreamContext Conn nats.Conn // contains filtered or unexported fields }
func NewPubSubClient ¶
func NewPubSubClient(logger *zap.SugaredLogger) (*PubSubClient, error)
#nosec
type PubSubConfig ¶
type PubSubConfig struct {
NatsServerHost string `env:"NATS_SERVER_HOST" envDefault:"nats://localhost:4222"`
}
type PublishRequest ¶
type PublishRequest struct { Topic string `json:"topic"` Payload json.RawMessage `json:"payload"` }
Click to show internal directories.
Click to hide internal directories.