cwlogs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwsToMs

func AwsToMs(ts int64) int64

AwsToMs converts millisecond epoch timestamp to a seconds epoch time

func AwsToTime

func AwsToTime(ts int64) time.Time

AwsToTime converts millisecond epoch timestamp to a Time

func Log

func Log(client *cloudwatchlogs.Client, eventChannel chan CWLEvent, logGroups []string, startTime *time.Time, endTime *time.Time)

Log starts reading events from the client and posting them to eventChannel Currently only the first log group from logGroups is used

func TimeToAws

func TimeToAws(tm time.Time) int64

TimeToAws converts a Time to a millisecond epoch timestamp

Types

type AfterAddFunc

type AfterAddFunc func()

type Arn

type Arn interface {
	ShortName() string
	Arn() string
}

Arn object

func NewArn

func NewArn(arn string) Arn

NewArn creates a new Arn

type CWLEvent

type CWLEvent interface {
	EventID() string
	Timestamp() time.Time
	Message() string
	LogGroup() string
	LogStream() string
	ShortStreamName() string
}

CWLEvent contains data that comprises an cloudwatch logs event

type Deduplicator

type Deduplicator interface {
	GetLastTimestamp() int64
	AddAndExecuteIfNotPresent(eventID string, timestamp int64, afterAdd AfterAddFunc)
}

func NewDeduplicator

func NewDeduplicator(sizeLimit int, timeToLive time.Duration) Deduplicator

type LogGroupConfig

type LogGroupConfig struct {
	Group        string
	StreamPrefix string
	Region       string
}

LogGroupConfig contains configuration parameters of awslogs driver, including group name, stream prefix and aws region

type LogStreamingContext

type LogStreamingContext struct {
	Client       *cloudwatchlogs.Client
	Streams      LogStreams
	Dedupe       Deduplicator
	StartTime    *time.Time
	EndTime      *time.Time
	EventChannel chan CWLEvent
}

type LogStreams

type LogStreams interface {
	Get() *logStream
	Update(stream logStream)
}

Jump to

Keyboard shortcuts

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