Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputArg ¶
InputArg holds kafka message data and offset.User send InputArg to the decoder, and the decoder will decode kafka message and return OutputResult to user.
type Logger ¶
type Logger interface {
Printf(string, ...interface{})
}
Logger is an interface that can be implemented to provide custom log output.
var DefaultLogger Logger = defaultLogger{}
DefaultLogger uses the stdlib log package for logging.
type OperationDecoder ¶
type OperationDecoder struct {
// contains filtered or unexported fields
}
func NewOperationDecoder ¶
func NewOperationDecoder(cfg *Config) (*OperationDecoder, error)
NewOperationDecoder need to know last CommitSeq of last OutputResult user has handled/consumed, it can be 0 if user first time create decoder, or user didn't save CommitSeq.
func (*OperationDecoder) Close ¶
func (o *OperationDecoder) Close() error
func (*OperationDecoder) Err ¶
func (o *OperationDecoder) Err() <-chan error
func (*OperationDecoder) Output ¶
func (o *OperationDecoder) Output() <-chan *OutputResult
type OutputResult ¶
type OutputResult struct { Ops []*protocol.Operation BeginSeq uint64 EndSeq uint64 BeginOffset int64 EndOffset int64 CommitOffset int64 CommitSeq uint64 }
OutputResult holds operations decoded from kafka message, seq info, offset info and commit info. Once user has handled/consumed this OutputResult, user can save/commit the commit info. After user restart, user can continue consume kafka from offset at CommitOffset+1.