Documentation ¶
Index ¶
- Constants
- type Config
- type Entry
- type Fluent
- func (f *Fluent) Close() (err error)
- func (f *Fluent) EncodeAndPostData(tag string, tm time.Time, message interface{}) error
- func (f *Fluent) EncodeData(tag string, tm time.Time, message interface{}) (data []byte, err error)
- func (f *Fluent) Post(tag string, message interface{}) error
- func (f *Fluent) PostRawData(data []byte)deprecated
- func (f *Fluent) PostWithTime(tag string, tm time.Time, message interface{}) error
- type Forward
- type Message
- type MessageChunk
Constants ¶
View Source
const Version = "1.2.1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FluentPort int `json:"fluent_port"` FluentHost string `json:"fluent_host"` FluentNetwork string `json:"fluent_network"` FluentSocketPath string `json:"fluent_socket_path"` Timeout time.Duration `json:"timeout"` BufferLimit int `json:"buffer_limit"` RetryWait int `json:"retry_wait"` MaxRetry int `json:"max_retry"` TagPrefix string `json:"tag_prefix"` AsyncConnect bool `json:"async_connect"` MarshalAsJSON bool `json:"marshal_as_json"` }
type Entry ¶ added in v1.0.0
type Entry struct { Time int64 `msg:"time"` Record interface{} `msg:"record"` }
func (Entry) MarshalMsg ¶ added in v1.0.0
MarshalMsg implements msgp.Marshaler
type Fluent ¶
type Fluent struct { Config // contains filtered or unexported fields }
func (*Fluent) EncodeAndPostData ¶ added in v1.0.0
func (*Fluent) EncodeData ¶ added in v1.0.0
func (*Fluent) Post ¶
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
deprecated
added in
v1.0.0
type Forward ¶ added in v1.0.0
type Forward struct { Tag string `msg:"tag"` Entries []Entry `msg:"entries"` Option interface{} `msg:"option"` }
func (*Forward) MarshalMsg ¶ added in v1.0.0
MarshalMsg implements msgp.Marshaler
type Message ¶ added in v1.0.0
type Message struct { Tag string `msg:"tag"` Time int64 `msg:"time"` Record interface{} `msg:"record"` Option interface{} `msg:"option"` }
func (*Message) MarshalMsg ¶ added in v1.0.0
MarshalMsg implements msgp.Marshaler
type MessageChunk ¶ added in v1.2.0
type MessageChunk struct {
// contains filtered or unexported fields
}
For sending forward protocol adopted JSON
func (*MessageChunk) MarshalJSON ¶ added in v1.2.0
func (chunk *MessageChunk) MarshalJSON() ([]byte, error)
Golang default marshaler does not support ["value", "value2", {"key":"value"}] style marshaling. So, it should write JSON marshaler by hand.
Click to show internal directories.
Click to hide internal directories.