firehose-to-syslog: github.com/cloudfoundry-community/firehose-to-syslog/diodes Index | Files

package diodes

import "github.com/cloudfoundry-community/firehose-to-syslog/diodes"

Index

Package Files

many_to_one.go many_to_one_envelope.go one_to_one.go one_to_one_envelope.go

type ManyToOne Uses

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

ManyToOne diode is optimal for many writers and a single reader for slices of bytes.

func NewManyToOne Uses

func NewManyToOne(size int, alerter gendiodes.Alerter) *ManyToOne

NewManyToOne initializes a new many to one diode of a given size and alerter. The alerter is called whenever data is dropped with an integer representing the number of byte slices that were dropped.

func (*ManyToOne) Next Uses

func (d *ManyToOne) Next() []byte

Next will return the next item to be read from the diode. If the diode is empty this method will block until an item is available to be read.

func (*ManyToOne) Set Uses

func (d *ManyToOne) Set(data []byte)

Set inserts the given data into the diode.

func (*ManyToOne) TryNext Uses

func (d *ManyToOne) TryNext() ([]byte, bool)

TryNext returns the next item to be read from the diode. If the diode is empty it will return a nil slice of bytes and false for the bool.

type ManyToOneEnvelope Uses

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

ManyToOneEnvelope diode is optimal for many writers and a single reader for V1 envelopes.

func NewManyToOneEnvelope Uses

func NewManyToOneEnvelope(size int, alerter gendiodes.Alerter) *ManyToOneEnvelope

NewManyToOneEnvelope returns a new ManyToOneEnvelope diode to be used with many writers and a single reader.

func (*ManyToOneEnvelope) Next Uses

func (d *ManyToOneEnvelope) Next() *events.Envelope

Next will return the next V1 envelope to be read from the diode. If the diode is empty this method will block until anenvelope is available to be read.

func (*ManyToOneEnvelope) Set Uses

func (d *ManyToOneEnvelope) Set(data *events.Envelope)

Set inserts the given V1 envelope into the diode.

func (*ManyToOneEnvelope) TryNext Uses

func (d *ManyToOneEnvelope) TryNext() (*events.Envelope, bool)

TryNext returns the next V1 envelope to be read from the diode. If the diode is empty it will return a nil envelope and false for the bool.

type OneToOne Uses

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

OneToOne diode is optimized for a single writer and a single reader for byte slices.

func NewOneToOne Uses

func NewOneToOne(size int, alerter gendiodes.Alerter) *OneToOne

NewOneToOne initializes a new one to one diode of a given size and alerter. The alerter is called whenever data is dropped with an integer representing the number of byte slices that were dropped.

func (*OneToOne) Next Uses

func (d *OneToOne) Next() []byte

Next will return the next item to be read from the diode. If the diode is empty this method will block until an item is available to be read.

func (*OneToOne) Set Uses

func (d *OneToOne) Set(data []byte)

Set inserts the given data into the diode.

func (*OneToOne) TryNext Uses

func (d *OneToOne) TryNext() ([]byte, bool)

TryNext returns the next item to be read from the diode. If the diode is empty it will return a nil slice of bytes and false for the bool.

type OneToOneEnvelope Uses

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

ManyToOneEnvelope diode is optimal for many writers and a single reader for V1 envelopes.

func NewOneToOneEnvelope Uses

func NewOneToOneEnvelope(size int, alerter gendiodes.Alerter) *OneToOneEnvelope

NewManyToOneEnvelope returns a new ManyToOneEnvelope diode to be used with many writers and a single reader.

func (*OneToOneEnvelope) Next Uses

func (d *OneToOneEnvelope) Next() *events.Envelope

Next will return the next V1 envelope to be read from the diode. If the diode is empty this method will block until anenvelope is available to be read.

func (*OneToOneEnvelope) Set Uses

func (d *OneToOneEnvelope) Set(data *events.Envelope)

Set inserts the given V1 envelope into the diode.

func (*OneToOneEnvelope) TryNext Uses

func (d *OneToOneEnvelope) TryNext() (*events.Envelope, bool)

TryNext returns the next V1 envelope to be read from the diode. If the diode is empty it will return a nil envelope and false for the bool.

Package diodes imports 2 packages (graph) and is imported by 1 packages. Updated 2018-02-09. Refresh now. Tools for package owners.