pubsub

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 16

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL