producer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQS    = "sqs"
	GOOGLE = "google"
	KAFKA  = "kafka"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleConfig

type GoogleConfig struct {
	ProjectID string
	TopicName string
	Target    string
	Rate      int
	Payload   []byte
}

type GoogleProducer

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

func (*GoogleProducer) Broadcast

func (g *GoogleProducer) Broadcast() error

type KafkaAuth

type KafkaAuth struct {
	Type     string
	Hash     string
	TLS      bool
	Username string
	Password string
}

type KafkaConfig

type KafkaConfig struct {
	Address []string
	Topic   string
	Rate    int
	Payload []byte
	Auth    *KafkaAuth
}

type KafkaProducer

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

func NewKafkaProducer

func NewKafkaProducer(cfg *KafkaConfig) (*KafkaProducer, error)

func (*KafkaProducer) Broadcast

func (k *KafkaProducer) Broadcast() error

type Producer

type Producer interface {
	Broadcast() error
}

func NewGoogleProducer

func NewGoogleProducer(cfg *GoogleConfig) (Producer, error)

func NewSqsProducer

func NewSqsProducer(cfg *SqsConfig) (Producer, error)

type SqsConfig

type SqsConfig struct {
	AccessKeyID     string
	SecretAccessKey string
	Region          string
	QueueName       string
	Payload         []byte
	Rate            int
}

type SqsProducer

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

func (*SqsProducer) Broadcast

func (s *SqsProducer) Broadcast() error

Jump to

Keyboard shortcuts

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