Documentation ¶
Index ¶
- Variables
- type Broker
- func (b *Broker) CurrentOffset(topic string, partition int32) int64
- func (b *Broker) Leave() error
- func (b *Broker) NewestOffset(topic string, partition int32) int64
- func (b *Broker) RegisterCallback(cb Callback)
- func (b *Broker) Run(ctx context.Context, requests <-chan *Context, responses chan<- *Context)
- func (b *Broker) Shutdown() error
- type Callback
- type Context
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) Err() error
- func (ctx *Context) Request() interface{}
- func (ctx *Context) Response() interface{}
- func (ctx *Context) ResponseToBytes() ([]byte, error)
- func (ctx *Context) Value(key interface{}) interface{}
- type Handler
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTopicExists = errors.New("topic exists already") ErrInvalidArgument = errors.New("no logger set") OffsetsTopicName = "__consumer_offsets" OffsetsTopicNumPartitions = 50 )
Functions ¶
This section is empty.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker represents a broker in a Jocko cluster, like a broker in a Kafka cluster.
func (*Broker) RegisterCallback ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) ResponseToBytes ¶
type Handler ¶
type Handler interface { Run(context.Context, <-chan *Context, chan<- *Context) RegisterCallback(Callback) Leave() error Shutdown() error }
Broker is the interface that wraps the Broker's methods.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is used to handle the TCP connections, decode requests, defer to the broker, and encode the responses.
func (*Server) RegisterCallback ¶
Click to show internal directories.
Click to hide internal directories.