Documentation ¶ Index ¶ type Batcher func New(opts ...Option) *Batcher func (b *Batcher) Add(key string, val interface{}) error func (b *Batcher) Close() func (b *Batcher) Start() type Option func WithBuffer(b int) Option func WithInterval(i time.Duration) Option func WithSize(s int) Option func WithWorker(w int) Option Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Batcher ¶ type Batcher struct { Do func(ctx context.Context, val map[string][]interface{}) Sharding func(key string) int // contains filtered or unexported fields } func New ¶ func New(opts ...Option) *Batcher func (*Batcher) Add ¶ func (b *Batcher) Add(key string, val interface{}) error func (*Batcher) Close ¶ func (b *Batcher) Close() func (*Batcher) Start ¶ func (b *Batcher) Start() type Option ¶ type Option interface { // contains filtered or unexported methods } func WithBuffer ¶ func WithBuffer(b int) Option func WithInterval ¶ func WithInterval(i time.Duration) Option func WithSize ¶ func WithSize(s int) Option func WithWorker ¶ func WithWorker(w int) Option Source Files ¶ View all Source files batcher.go Click to show internal directories. Click to hide internal directories.