ammo

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2016 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ammo

type Ammo interface{}

func Drain

func Drain(ctx context.Context, p Provider) []Ammo

Drain reads all ammos from ammo.Provider. Useful for tests.

type BaseProvider

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

func NewBaseProvider

func NewBaseProvider(source <-chan Ammo, decoder Decoder, New func() interface{}) *BaseProvider

func (*BaseProvider) Release

func (ap *BaseProvider) Release(a Ammo)

func (*BaseProvider) Source

func (ap *BaseProvider) Source() <-chan Ammo

type Decoder

type Decoder interface {
	Decode([]byte, Ammo) (Ammo, error)
}

func NewLogJSONDecoder

func NewLogJSONDecoder() Decoder

type Http

type Http struct {
	Host    string
	Method  string
	Uri     string
	Headers map[string]string
	Tag     string
}

ffjson: noencoder

func (*Http) UnmarshalJSON

func (uj *Http) UnmarshalJSON(input []byte) error

func (*Http) UnmarshalJSONFFLexer

func (uj *Http) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type HttpJSONDecoder

type HttpJSONDecoder struct{}

HttpJSONDecoder implements ammo.Decoder interface

func (*HttpJSONDecoder) Decode

func (d *HttpJSONDecoder) Decode(jsonDoc []byte, a Ammo) (Ammo, error)

type HttpProvider

type HttpProvider struct {
	*BaseProvider
	// contains filtered or unexported fields
}

ffjson: skip

func (*HttpProvider) Start

func (ap *HttpProvider) Start(ctx context.Context) error

type Log

type Log struct {
	Message string
}

type LogJSONDecoder

type LogJSONDecoder struct{}

LogJSONDecoder implements ammo.Decoder interface

func (*LogJSONDecoder) Decode

func (*LogJSONDecoder) Decode(jsonDoc []byte, a Ammo) (Ammo, error)

type LogProvider

type LogProvider struct {
	*BaseProvider
	// contains filtered or unexported fields
}

func (*LogProvider) Start

func (ap *LogProvider) Start(ctx context.Context) error

type Provider

type Provider interface {
	Start(context.Context) error
	Source() <-chan Ammo
	Release(Ammo) // return unused Ammo object to memory pool
}

func NewHttpProvider

func NewHttpProvider(c *config.AmmoProvider) (Provider, error)

func NewLogAmmoProvider

func NewLogAmmoProvider(c *config.AmmoProvider) (Provider, error)

Jump to

Keyboard shortcuts

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