fluent

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2016 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FluentPort  int
	FluentHost  string
	Timeout     time.Duration
	BufferLimit int
	RetryWait   int
	MaxRetry    int
	TagPrefix   string
}

type Entry

type Entry struct {
	Time   int64       `msg:"time"`
	Record interface{} `msg:"record"`
}

func (*Entry) DecodeMsg

func (z *Entry) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Entry) EncodeMsg

func (z Entry) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Entry) MarshalMsg

func (z Entry) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Entry) Msgsize

func (z Entry) Msgsize() (s int)

func (*Entry) UnmarshalMsg

func (z *Entry) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Fluent

type Fluent struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(config Config) (f *Fluent, err error)

New creates a new Logger.

func (*Fluent) Close

func (f *Fluent) Close() (err error)

Close closes the connection.

func (*Fluent) EncodeAndPostData

func (f *Fluent) EncodeAndPostData(tag string, tm time.Time, message interface{}) error

func (*Fluent) EncodeData

func (f *Fluent) EncodeData(tag string, tm time.Time, message interface{}) (data []byte, err error)

func (*Fluent) Post

func (f *Fluent) Post(tag string, message interface{}) error

Post writes the output for a logging event.

Examples:

// send string
f.Post("tag_name", "data")

// send map[string]
mapStringData := map[string]string{
	"foo":  "bar",
}
f.Post("tag_name", mapStringData)

// send message with specified time
mapStringData := map[string]string{
	"foo":  "bar",
}
tm := time.Now()
f.PostWithTime("tag_name", tm, mapStringData)

// send struct
structData := struct {
		Name string `msg:"name"`
} {
		"john smith",
}
f.Post("tag_name", structData)

func (*Fluent) PostRawData

func (f *Fluent) PostRawData(data []byte)

func (*Fluent) PostWithTime

func (f *Fluent) PostWithTime(tag string, tm time.Time, message interface{}) error

type Forward

type Forward struct {
	Tag     string      `msg:"tag"`
	Entries []Entry     `msg:"entries"`
	Option  interface{} `msg:"option"`
}

func (*Forward) DecodeMsg

func (z *Forward) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Forward) EncodeMsg

func (z *Forward) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Forward) MarshalMsg

func (z *Forward) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Forward) Msgsize

func (z *Forward) Msgsize() (s int)

func (*Forward) UnmarshalMsg

func (z *Forward) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Message

type Message struct {
	Tag    string      `msg:"tag"`
	Time   int64       `msg:"time"`
	Record interface{} `msg:"record"`
	Option interface{} `msg:"option"`
}

func (*Message) DecodeMsg

func (z *Message) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Message) EncodeMsg

func (z *Message) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Message) MarshalMsg

func (z *Message) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Message) Msgsize

func (z *Message) Msgsize() (s int)

func (*Message) UnmarshalMsg

func (z *Message) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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