buffer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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 BatchBuffer

type BatchBuffer struct {
	// contains filtered or unexported fields
}

BatchBuffer is a buffer to cache the input data in Sender.

func NewBatchBuffer

func NewBatchBuffer(capacity int) *BatchBuffer

NewBuffer crate a new BatchBuffer according to the capacity param.

func (*BatchBuffer) Add

func (b *BatchBuffer) Add(data *event.OutputEventContext)

Add adds a new data input buffer.

func (*BatchBuffer) Buf

func (b *BatchBuffer) Buf() []*event.OutputEventContext

Buf returns the cached data in BatchBuffer.

func (*BatchBuffer) First

func (b *BatchBuffer) First() event.Offset

First returns the first OutputEventContext offset.

func (*BatchBuffer) Last

func (b *BatchBuffer) Last() event.Offset

Last returns the last OutputEventContext offset.

func (*BatchBuffer) Len

func (b *BatchBuffer) Len() int

Len returns the usage size.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL