consumer

package
Version: v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Publish(m Message) error
	Close() error
}

type ClientConfig

type ClientConfig struct {
}

type Consumer

type Consumer interface {
	Run(c *ConsumerEntity) error

	Stop()

	UpdateConfig(*common.Config)
}

Consumer is the interface that must be implemented by every ConsumerEntity

type ConsumerConfig

type ConsumerConfig struct {
	// output/publishing related configurations
	Output common.ConfigNamespace `config:"output" json:"output"`
}

ConsumerConfig struct contains the basic configuration of every consumer

type ConsumerEntity

type ConsumerEntity struct {
	Info      Info
	Publisher Pipeline // Publisher pipeline

	Config *ConsumerConfig

	ConsumerConfig *common.Config

	EtcdConfig *EtcdConfig
}

type Creator

type Creator func(*ConsumerEntity, *common.Config) (Consumer, error)

type EtcdConfig

type EtcdConfig struct {
	Endpoints []string
	Username  string
	Password  string
	Path      string
}

type Info

type Info struct {
	Consumer    string
	IndexPrefix string
	Version     string
	Name        string // configured consumer name
}

type Message

type Message interface {
	GetNsqMessage() *nsq.Message
	Body() []byte
	GetTopic() string
	GetMessageBody() []byte
}

type Pipeline

type Pipeline interface {
	ConnectWith(ClientConfig) (Client, error)
	Connect() (Client, error)
	HandleMessage(m Message) error
	Close() error
}

type PipelineConnector

type PipelineConnector = Pipeline

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL