Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrShuttingDown = errors.New("server shutting down") ErrBusy = errors.New("underlying store too busy") ErrTooManyConsumers = errors.New("consumers more than available partitions") ErrRebalancing = errors.New("rebalancing, please retry after a while") ErrInvalidTopic = errors.New("invalid topic") ErrInvalidCluster = errors.New("invalid cluster") ErrEmptyBrokers = errors.New("empty active brokers") ErrCircuitOpen = errors.New("circuit open, underlying store problems") )
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher interface { // Messages returns a stream messages being consumed. Messages() <-chan *sarama.ConsumerMessage // Errors returns a stream errors during consuming. Errors() <-chan *sarama.ConsumerError // CommitUpto records the cursor/offset of where messages are consumed. CommitUpto(*sarama.ConsumerMessage) error // Close the Fetcher and do all the cleanups. Close() error }
A Fetcher is a generic high level streamed consumer.
type PubStore ¶
type PubStore interface { // Name returns the name of the underlying store. Name() string Start() error Stop() // SyncPub pub a keyed message to a topic of a cluster synchronously. SyncPub(cluster, topic string, key, msg []byte) (partition int32, offset int64, err error) // SyncAllPub pub a keyed message to all replicas before sending response. SyncAllPub(cluster, topic string, key, msg []byte) (partition int32, offset int64, err error) // AsyncPub pub a keyed message to a topic of a cluster asynchronously. AsyncPub(cluster, topic string, key, msg []byte) (partition int32, offset int64, err error) IsSystemError(error) bool }
A PubStore is a generic store that can Pub sync/async.
var DefaultPubStore PubStore
type SubStore ¶
type SubStore interface { // Name returns the name of the underlying store. Name() string Start() error Stop() // Fetch returns a Fetcher. Fetch(cluster, topic, group, remoteAddr, realIp, resetOffset string, permitStandby, mux bool) (Fetcher, error) IsSystemError(error) bool }
A SubStore is a generic data source that can be used to fetch messages.
var DefaultSubStore SubStore
Click to show internal directories.
Click to hide internal directories.