pubsub

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 16

Documentation

Index

Constants

View Source
const CD_SUCCESS = "ORCHESTRATOR.CD.TRIGGER"

Variables

This section is empty.

Functions

This section is empty.

Types

type NatsPublishClient

type NatsPublishClient interface {
	Publish(req *PublishRequest) (string, 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) (string, error)

type PubSubClient

type PubSubClient struct {
	Conn        stan.Conn
	AckDuration int
	// 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"`
	ClusterId      string `env:"CLUSTER_ID" envDefault:"devtron-stan"`
	ClientId       string `env:"CLIENT_ID" envDefault:"orchestrator"`
	AckDuration    string `env:"ACK_DURATION" envDefault:"30"`
}

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