buffer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 6 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesItem

type BytesItem []byte

func (BytesItem) Size

func (s BytesItem) Size() int64

type Chunk

type Chunk interface {
	Push(Sizer)
}

type ChunkHandler

type ChunkHandler func(c Chunk) error

type Duration

type Duration time.Duration

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(b []byte) error

type Handler

type Handler interface {
	Write([]Sizer) (int, error)
}

type HumanSize

type HumanSize int64

func (*HumanSize) UnmarshalText

func (s *HumanSize) UnmarshalText(b []byte) error

type Memory

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

func NewMemory

func NewMemory(opts *Options, h Handler) *Memory

func (*Memory) Close

func (m *Memory) Close()

func (*Memory) Push

func (m *Memory) Push(s Sizer) error

type MemoryChunk

type MemoryChunk struct {
	Size  int64
	Items []Sizer
}

func (*MemoryChunk) Push

func (m *MemoryChunk) Push(s Sizer)

type Options

type Options struct {
	Name             string    `toml:"name" codec:"name"`
	Type             string    `toml:"type" codec:"type"`
	MaxChunkSize     HumanSize `toml:"max_chunk_size" codec:"max_chunk_size"`
	MaxQueueSize     HumanSize `toml:"max_queue_size" codec:"max_queue_size"`
	FlushInterval    Duration  `toml:"flush_interval" codec:"flush_interval"`
	RetryInterval    Duration  `toml:"retry_interval" codec:"retry_interval"`
	MaxRetryInterval Duration  `toml:"max_retry_interval" codec:"max_retry_interval"`
}

func (*Options) SetDefault

func (o *Options) SetDefault()

type Sizer

type Sizer interface {
	Size() int64
}

type StringItem

type StringItem string

func (StringItem) Size

func (s StringItem) Size() int64

Jump to

Keyboard shortcuts

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