ecs-logs: github.com/segmentio/ecs-logs/lib Index | Files | Directories

package lib

import "github.com/segmentio/ecs-logs/lib"

Index

Package Files

destination.go error.go group.go log.go message.go reader.go source.go store.go stream.go writer.go

func AppendError Uses

func AppendError(err error, other error) error

func DeregisterDestination Uses

func DeregisterDestination(name string)

func DeregisterSource Uses

func DeregisterSource(name string)

func DestinationsAvailable Uses

func DestinationsAvailable() (destinations []string)

func RegisterDestination Uses

func RegisterDestination(name string, destination Destination)

func RegisterSource Uses

func RegisterSource(name string, source Source)

func SourcesAvailable Uses

func SourcesAvailable() (sources []string)

type Destination Uses

type Destination interface {
    Open(group string, stream string) (Writer, error)

    Close(group string, stream string)
}

func GetDestination Uses

func GetDestination(name string) (destination Destination)

func GetDestinations Uses

func GetDestinations(names ...string) (destinations []Destination)

type DestinationFunc Uses

type DestinationFunc func(group string, stream string) (Writer, error)

func (DestinationFunc) Close Uses

func (f DestinationFunc) Close(group string, stream string)

func (DestinationFunc) Open Uses

func (f DestinationFunc) Open(group string, stream string) (Writer, error)

type ErrorList Uses

type ErrorList []error

func (ErrorList) Error Uses

func (err ErrorList) Error() string

type Group Uses

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

func NewGroup Uses

func NewGroup(name string, now time.Time) *Group

func (*Group) Add Uses

func (group *Group) Add(msg Message, now time.Time) (stream *Stream)

func (*Group) ForEach Uses

func (group *Group) ForEach(f func(*Stream))

func (*Group) HasExpired Uses

func (group *Group) HasExpired(timeout time.Duration, now time.Time) bool

func (*Group) Name Uses

func (group *Group) Name() string

func (*Group) RemoveExpired Uses

func (group *Group) RemoveExpired(timeout time.Duration, now time.Time) (streams []*Stream)

func (*Group) String Uses

func (group *Group) String() string

type LogHandler Uses

type LogHandler struct {
    Group    string
    Stream   string
    Hostname string
    Queue    *MessageQueue
}

func (*LogHandler) HandleLog Uses

func (h *LogHandler) HandleLog(entry *log.Entry) (err error)

type LogLevel Uses

type LogLevel log.Level

func (LogLevel) Get Uses

func (lvl LogLevel) Get() interface{}

func (*LogLevel) Set Uses

func (lvl *LogLevel) Set(s string) error

func (LogLevel) String Uses

func (lvl LogLevel) String() string

type Message Uses

type Message struct {
    Group  string        `json:"group,omitempty"`
    Stream string        `json:"stream,omitempty"`
    Event  ecslogs.Event `json:"event,omitempty"`
}

func (Message) Bytes Uses

func (m Message) Bytes() []byte

func (Message) ContentLength Uses

func (m Message) ContentLength() int

func (Message) String Uses

func (m Message) String() string

type MessageBatch Uses

type MessageBatch []Message

func (MessageBatch) Len Uses

func (list MessageBatch) Len() int

func (MessageBatch) Less Uses

func (list MessageBatch) Less(i int, j int) bool

func (MessageBatch) Swap Uses

func (list MessageBatch) Swap(i int, j int)

type MessageQueue Uses

type MessageQueue struct {
    C <-chan struct{}
    // contains filtered or unexported fields
}

func NewMessageQueue Uses

func NewMessageQueue() *MessageQueue

func (*MessageQueue) Flush Uses

func (q *MessageQueue) Flush() (batch MessageBatch)

func (*MessageQueue) Notify Uses

func (q *MessageQueue) Notify()

func (*MessageQueue) Push Uses

func (q *MessageQueue) Push(msg Message)

type Reader Uses

type Reader interface {
    io.Closer

    ReadMessage() (Message, error)
}

func NewMessageDecoder Uses

func NewMessageDecoder(r io.Reader) Reader

type Source Uses

type Source interface {
    Open() (Reader, error)
}

func GetSource Uses

func GetSource(name string) (source Source)

func GetSources Uses

func GetSources(names ...string) (sources []Source)

type SourceFunc Uses

type SourceFunc func() (Reader, error)

func (SourceFunc) Open Uses

func (f SourceFunc) Open() (Reader, error)

type Store Uses

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

func NewStore Uses

func NewStore() *Store

func (*Store) Add Uses

func (store *Store) Add(msg Message, now time.Time) (group *Group, stream *Stream)

func (*Store) ForEach Uses

func (store *Store) ForEach(f func(*Group))

func (*Store) RemoveExpired Uses

func (store *Store) RemoveExpired(timeout time.Duration, now time.Time) (streams []*Stream)

type Stream Uses

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

func NewStream Uses

func NewStream(group string, name string, now time.Time) *Stream

func (*Stream) Add Uses

func (stream *Stream) Add(msg Message, now time.Time)

func (*Stream) Flush Uses

func (stream *Stream) Flush(limits StreamLimits, now time.Time) (list MessageBatch, reason string)

func (*Stream) Group Uses

func (stream *Stream) Group() string

func (*Stream) HasExpired Uses

func (stream *Stream) HasExpired(timeout time.Duration, now time.Time) bool

func (*Stream) Name Uses

func (stream *Stream) Name() string

func (*Stream) String Uses

func (stream *Stream) String() string

type StreamLimits Uses

type StreamLimits struct {
    MaxCount int
    MaxBytes int
    MaxTime  time.Duration
    Force    bool
}

type Writer Uses

type Writer interface {
    io.Closer

    WriteMessage(Message) error

    WriteMessageBatch(MessageBatch) error
}

func NewMessageEncoder Uses

func NewMessageEncoder(w io.Writer) Writer

Directories

PathSynopsis
cloudwatchlogs
datadog
journald
logdna
loggly
statsd
syslog
syslog/pool

Package lib imports 12 packages (graph) and is imported by 8 packages. Updated 2019-02-26. Refresh now. Tools for package owners.