zebrule

package
v0.0.0-...-ea2d6a4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aluminum

type Aluminum interface {
	Bytes() []byte
}

Aluminum is the data interface, in case you don't want to use the default

type Data

type Data struct {
	Type     string   `required:"true"` //which destination to report to
	Aluminum Aluminum `required:"true"`
}

Data is what the zebrule reports

type Destination

type Destination struct {
	Type   reflect.Type `required:"true"`
	ID     string       `required:"true"`
	Config *interface{} `required:"true"`
}

Destination is where the stuff gets sent

func NewDestination

func NewDestination(id string, conf interface{}) Destination

NewDestination returns a blank destination to use

type Zebrule

type Zebrule struct {
	Fatal   Destination `required:"true"`
	Warning Destination `required:"true"`
	Error   Destination `required:"true"`
	Debug   Destination `required:"true"`
	Info    Destination `required:"true"`
	Notice  Destination `required:"true"`
}

Zebrule is a poor struct, brought into this world only to eat aluminum and stream logs

func Must

func Must(zeb *Zebrule, err error) *Zebrule

Must wrapper to ensure New doesn't return an error

func NewZebrule

func NewZebrule(fatal, erro, warning Destination) (*Zebrule, error)

NewZebrule returns a zebrule to use

func (*Zebrule) Feed

func (z *Zebrule) Feed(report Data) error

Feed tells the zebrule what to stream out

func (*Zebrule) SetDebug

func (z *Zebrule) SetDebug(id string, c interface{}) (*Zebrule, error)

SetDebug creates a new hose

func (*Zebrule) SetError

func (z *Zebrule) SetError(id string, c interface{}) (*Zebrule, error)

SetError creates a new hose

func (*Zebrule) SetInfo

func (z *Zebrule) SetInfo(id string, c interface{}) (*Zebrule, error)

SetInfo creates a new hose

func (*Zebrule) SetNotice

func (z *Zebrule) SetNotice(id string, c interface{}) (*Zebrule, error)

SetNotice creates a new hose

func (*Zebrule) SetWarning

func (z *Zebrule) SetWarning(id string, c interface{}) (*Zebrule, error)

SetWarning creates a new hose

Jump to

Keyboard shortcuts

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