Documentation ¶
Index ¶
- Constants
- Variables
- func NewChannel() (chan *fluent.FluentRecordSet, chan Stat)
- func NewFluentRecordSet(tag string, key string, buffer *[]byte) *fluent.FluentRecordSet
- func Rel2Abs(filename string) (string, error)
- type Config
- type ConfigLogfile
- type ConfigReceiver
- type ConfigServer
- type File
- type FileStat
- type InForward
- type InTail
- type MessageQueue
- type Monitor
- type OutForward
- type SentStat
- type ServerStat
- type ShutdownType
- type Stat
- type Stats
- type Watcher
Constants ¶
View Source
const ( DefaultFluentdPort = 24224 DefaultFieldName = "message" )
View Source
const ( OpenRetryInterval = 1 * time.Second SEEK_TAIL = int64(-1) SEEK_HEAD = int64(0) DEBUG = false )
View Source
const ( MessageChannelBufferLen = 1 MonitorChannelBufferLen = 256 )
View Source
const (
TailInterval = 200 * time.Millisecond
)
Variables ¶
View Source
var (
LineSeparator = []byte{'\n'}
)
View Source
var (
ReadBufferSize = 64 * 1024
)
Functions ¶
func NewChannel ¶
func NewChannel() (chan *fluent.FluentRecordSet, chan Stat)
NewChannel create channel for using by OutForward() and InTail().
func NewFluentRecordSet ¶
func NewFluentRecordSet(tag string, key string, buffer *[]byte) *fluent.FluentRecordSet
Types ¶
type Config ¶
type Config struct { TagPrefix string FieldName string Servers []*ConfigServer Logs []*ConfigLogfile Receivers []*ConfigReceiver MonitorAddress string }
func NewConfigByArgs ¶
func ReadConfig ¶
type ConfigLogfile ¶
func (*ConfigLogfile) Restrict ¶
func (cl *ConfigLogfile) Restrict(c *Config)
type ConfigReceiver ¶
func (*ConfigReceiver) Restrict ¶
func (cr *ConfigReceiver) Restrict(c *Config)
type ConfigServer ¶
func (*ConfigServer) Address ¶
func (cs *ConfigServer) Address() string
func (*ConfigServer) Restrict ¶
func (cs *ConfigServer) Restrict(c *Config)
type File ¶
type FileStat ¶
type InForward ¶
func NewInForward ¶
func NewInForward(config *ConfigReceiver, messageCh chan *fluent.FluentRecordSet, monitorCh chan Stat) (*InForward, error)
type InTail ¶
type InTail struct {
// contains filtered or unexported fields
}
func NewInTail ¶
func NewInTail(config *ConfigLogfile, watcher *Watcher, messageCh chan *fluent.FluentRecordSet, monitorCh chan Stat) (*InTail, error)
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
func NewMessageQueue ¶
func NewMessageQueue(maxLength int, drain bool) *MessageQueue
func (*MessageQueue) Dequeue ¶
func (q *MessageQueue) Dequeue() (interface{}, bool)
func (*MessageQueue) Disposed ¶
func (q *MessageQueue) Disposed() int
func (*MessageQueue) Enqueue ¶
func (q *MessageQueue) Enqueue(value interface{}) error
func (*MessageQueue) Len ¶
func (q *MessageQueue) Len() int
type OutForward ¶
type OutForward struct {
// contains filtered or unexported fields
}
func NewOutForward ¶
func NewOutForward(configServers []*ConfigServer, messageCh chan *fluent.FluentRecordSet, monitorCh chan Stat) (*OutForward, error)
OutForward ... recieve FluentRecordSet from channel, and send it to passed loggers until success.
func (*OutForward) Run ¶
func (f *OutForward) Run()
type SentStat ¶
type ServerStat ¶
type ServerStat struct { Index int `json:"-"` Address string `json:"address"` Alive bool `json:"alive"` Error string `json:"error"` }
func (*ServerStat) ApplyTo ¶
func (s *ServerStat) ApplyTo(ss *Stats)
type ShutdownType ¶
type ShutdownType struct {
// contains filtered or unexported fields
}
func (*ShutdownType) Error ¶
func (s *ShutdownType) Error() string
Click to show internal directories.
Click to hide internal directories.