producer

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package producer pushes decoded messages to message queues

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaSarama

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

KafkaSarama represents kafka producer

type KafkaSaramaConfig

type KafkaSaramaConfig struct {
	Brokers        []string `yaml:"brokers" env:"BROKERS"`
	Compression    string   `yaml:"compression" env:"COMPRESSION"`
	RetryMax       int      `yaml:"retry-max" env:"RETRY_MAX"`
	RequestSizeMax int32    `yaml:"request-size-max" env:"REQUEST_SIZE_MAX"`
	RetryBackoff   int      `yaml:"retry-backoff" env:"RETRY_BACKOFF"`
	TLSEnabled     bool     `yaml:"tls-enabled" env:"TLS_ENABLED"`
	TLSCertFile    string   `yaml:"tls-cert" env:"TLS_CERT"`
	TLSKeyFile     string   `yaml:"tls-key" env:"TLS_KEY"`
	CAFile         string   `yaml:"ca-file" env:"CA_FILE"`
	TLSSkipVerify  bool     `yaml:"tls-skip-verify" env:"TLS_SKIP_VERIFY"`
	SASLUsername   string   `yaml:"sasl-username" env:"SASL_USERNAME"`
	SASLPassword   string   `yaml:"sasl-password" env:"SASL_PASSWORD"`
}

KafkaSaramaConfig represents kafka configuration

type KafkaSegmentio

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

KafkaSegmentio represents kafka producer

type KafkaSegmentioConfig

type KafkaSegmentioConfig struct {
	Brokers         []string `yaml:"brokers" env:"BROKERS"`
	BootstrapServer string   `yaml:"bootstrap-server" env:"BOOTSTRAP_SERVER"`
	ClientID        string   `yaml:"client-id" env:"CLIENT_ID"`
	Compression     string   `yaml:"compression" env:"COMPRESSION"`
	MaxAttempts     int      `yaml:"max-attempts" env:"MAX_ATTEMPTS"`
	QueueSize       int      `yaml:"queue-size" env:"QUEUE_SIZE"`
	BatchSize       int      `yaml:"batch-size" env:"BATCH_SIZE"`
	KeepAlive       int      `yaml:"keepalive" env:"KEEPALIVE"`
	IOTimeout       int      `yaml:"connect-timeout" env:"CONNECT_TIMEOUT"`
	RequiredAcks    int      `yaml:"required-acks" env:"REQUIRED_ACKS"`
	PeriodicFlush   int      `yaml:"pflush" env:"PERIODIC_FLUSH"`
	TLSCertFile     string   `yaml:"tls-cert" env:"TLS_CERT"`
	TLSKeyFile      string   `yaml:"tls-key" env:"TLS_KEY"`
	CAFile          string   `yaml:"ca-file" env:"CA_FILE"`
	VerifySSL       bool     `yaml:"verify-ssl" env:"VERIFY_SSL"`
	// contains filtered or unexported fields
}

KafkaSegmentioConfig represents kafka configuration

type MQueue

type MQueue interface {
	// contains filtered or unexported methods
}

MQueue represents messaging queue methods

type NATS

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

NATS represents nats producer

type NATSConfig

type NATSConfig struct {
	URL string `yaml:"url"`
}

NATSConfig is the struct that holds all configuation for NATS connections

type NSQ

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

NSQ represents nsq producer

type NSQConfig

type NSQConfig struct {
	Server string `yaml:"server"`
}

NSQConfig represents NSQ configuration

type Producer

type Producer struct {
	MQ           MQueue
	MQConfigFile string
	MQErrorCount *uint64

	Topic string
	Chan  chan []byte

	Logger *log.Logger
}

Producer represents messaging queue

func NewProducer

func NewProducer(mqName string) *Producer

NewProducer constructs new Messaging Queue

func (*Producer) Run

func (p *Producer) Run() error

Run configs and tries to be ready to produce

func (*Producer) Shutdown

func (p *Producer) Shutdown()

Shutdown stops the producer

type RawSocket

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

RawSocket represents RawSocket producer

type RawSocketConfig

type RawSocketConfig struct {
	URL      string `yaml:"url"`
	Protocol string `yaml:"protocol"`
	MaxRetry int    `yaml:"retry-max"`
}

RawSocketConfig is the struct that holds all configuation for RawSocketConfig connections

Jump to

Keyboard shortcuts

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