pubsub

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(cfg *datastore.PubSubConfig) error

Types

type GooglePubSub

type GooglePubSub struct {
	ServiceAccount []byte `json:"service_account" valid:"required~service account is required"`
	SubscriptionID string `json:"subscription_id" valid:"required~subscription id is required"`
	ProjectID      string `json:"project_id" valid:"required~project id is required"`
}

type KafkaAuth added in v1.1.6

type KafkaAuth struct {
	Type     string `json:"type" valid:"optional,in(plain|scram)~unsupported auth type"`
	Hash     string `json:"hash" valid:"optional,in(SHA256|SHA512)~unsupported hashing algorithm"`
	Username string `json:"username"`
	Password string `json:"password"`
	TLS      bool   `json:"tls"`
}

type KafkaPubSub added in v1.1.6

type KafkaPubSub struct {
	Brokers         []string   `json:"brokers" valid:"required~brokers list is required"`
	ConsumerGroupID string     `json:"consumer_group_id" valid:"required~consumer group ID is required"`
	TopicName       string     `json:"topic_name" valid:"required~topic name is required"`
	Auth            *KafkaAuth `json:"auth"`
}

type PS

type PS struct {
	Type    datastore.PubSubType `json:"type" valid:"required~type is required,supported_pub_sub~unsupported pub sub type"`
	Workers int                  `json:"workers" valid:"required"`
}

type PubSub

type PubSub interface {
	Start()
	Consume()
	Stop()
}

func NewPubSubClient

func NewPubSubClient(source *datastore.Source, handler datastore.PubSubHandler, log log.StdLogger) (PubSub, error)

type PubSubSource

type PubSubSource struct {
	// contains filtered or unexported fields
}

func NewPubSubSource

func NewPubSubSource(source *datastore.Source, handler datastore.PubSubHandler, log log.StdLogger) (*PubSubSource, error)

func (*PubSubSource) Start

func (p *PubSubSource) Start()

func (*PubSubSource) Stop

func (p *PubSubSource) Stop()

type SourceLoader

type SourceLoader struct {
	// contains filtered or unexported fields
}

func NewSourceLoader

func NewSourceLoader(endpointRepo datastore.EndpointRepository, sourceRepo datastore.SourceRepository, projectRepo datastore.ProjectRepository, queue queue.Queuer, sourcePool *SourcePool, log log.StdLogger) *SourceLoader

func (*SourceLoader) Run

func (s *SourceLoader) Run(ctx context.Context, interval int, stop <-chan struct{})

type SourcePool

type SourcePool struct {
	// contains filtered or unexported fields
}

func NewSourcePool

func NewSourcePool(log log.StdLogger) *SourcePool

func (*SourcePool) Insert

func (s *SourcePool) Insert(ps *PubSubSource)

func (*SourcePool) Remove

func (s *SourcePool) Remove(sourceId string)

func (*SourcePool) Stop

func (s *SourcePool) Stop()

type SqsPubSub

type SqsPubSub struct {
	AccessKeyID   string `json:"access_key_id" valid:"required"`
	SecretKey     string `json:"secret_key" valid:"required"`
	DefaultRegion string `json:"default_region" valid:"required"`
	QueueName     string `json:"queue_name" valid:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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