pubsub

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MPL-2.0 Imports: 20 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 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(interval int)

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