buffer

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package buffer - Links an input and an output together and buffers messages in between.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Descriptions

func Descriptions() string

Descriptions - Returns a formatted string of collated descriptions of each type.

Types

type Config

type Config struct {
	Type   string                `json:"type" yaml:"type"`
	Mmap   impl.MmapBufferConfig `json:"mmap_file" yaml:"mmap_file"`
	Memory impl.MemoryConfig     `json:"memory" yaml:"memory"`
}

Config - The all encompassing configuration struct for all input types.

func NewConfig

func NewConfig() Config

NewConfig - Returns a configuration struct fully populated with default values.

type Empty

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

Empty - Empty buffer, simply forwards messages on directly.

func (*Empty) CloseAsync

func (e *Empty) CloseAsync()

CloseAsync - Shuts down the StackBuffer output and stops processing messages.

func (*Empty) ErrorsChan

func (e *Empty) ErrorsChan() <-chan []error

ErrorsChan - Returns the errors channel.

func (*Empty) MessageChan

func (e *Empty) MessageChan() <-chan types.Message

MessageChan - Returns the channel used for consuming messages from this input.

func (*Empty) ResponseChan

func (e *Empty) ResponseChan() <-chan types.Response

ResponseChan - Returns the response channel.

func (*Empty) StartListening

func (e *Empty) StartListening(responses <-chan types.Response) error

StartListening - Sets the channel for reading responses.

func (*Empty) StartReceiving

func (e *Empty) StartReceiving(msgs <-chan types.Message) error

StartReceiving - Assigns a messages channel for the output to read.

func (*Empty) WaitForClose

func (e *Empty) WaitForClose(timeout time.Duration) error

WaitForClose - Blocks until the StackBuffer output has closed down.

type OutputWrapper

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

OutputWrapper - Wraps a buffer with a Producer/Consumer interface.

func (*OutputWrapper) CloseAsync

func (m *OutputWrapper) CloseAsync()

CloseAsync - Shuts down the OutputWrapper and stops processing messages.

func (*OutputWrapper) ErrorsChan

func (m *OutputWrapper) ErrorsChan() <-chan []error

ErrorsChan - Returns the errors channel.

func (*OutputWrapper) MessageChan

func (m *OutputWrapper) MessageChan() <-chan types.Message

MessageChan - Returns the channel used for consuming messages from this input.

func (*OutputWrapper) ResponseChan

func (m *OutputWrapper) ResponseChan() <-chan types.Response

ResponseChan - Returns the response channel.

func (*OutputWrapper) StartListening

func (m *OutputWrapper) StartListening(responses <-chan types.Response) error

StartListening - Sets the channel for reading responses.

func (*OutputWrapper) StartReceiving

func (m *OutputWrapper) StartReceiving(msgs <-chan types.Message) error

StartReceiving - Assigns a messages channel for the output to read.

func (*OutputWrapper) WaitForClose

func (m *OutputWrapper) WaitForClose(timeout time.Duration) error

WaitForClose - Blocks until the OutputWrapper output has closed down.

type Type

type Type interface {
	types.Producer
	types.Consumer
	types.Closable

	// ErrorsChan - Returns the channel used for returning any accumulated errors. This needs
	// reading in the same select block where messages are sent as the errors can occur at any time.
	ErrorsChan() <-chan []error
}

Type - The standard interface of an agent type.

func New

func New(conf Config, log log.Modular, stats metrics.Type) (Type, error)

New - Create an input type based on an input configuration.

func NewEmpty

func NewEmpty(config Config, log log.Modular, stats metrics.Type) (Type, error)

NewEmpty - Supports buffer interface but doesn't buffer messages.

func NewMemory

func NewMemory(config Config, log log.Modular, stats metrics.Type) (Type, error)

NewMemory - Create a buffer held in memory.

func NewMmapFile

func NewMmapFile(config Config, log log.Modular, stats metrics.Type) (Type, error)

NewMmapFile - Create a buffer held in memory and persisted to file through memory map.

func NewOutputWrapper

func NewOutputWrapper(buffer impl.Buffer, stats metrics.Type) Type

NewOutputWrapper - Create a new Producer/Consumer around a buffer.

Directories

Path Synopsis
Package impl - Contains implementations of various buffer types.
Package impl - Contains implementations of various buffer types.

Jump to

Keyboard shortcuts

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