cloudwatchlogs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cloudwatchlogs provides a client to make API requests to Amazon CloudWatch Logs.

Package cloudwatchlogs contains utility functions for Cloudwatch Logs client.

Index

Constants

View Source
const (
	// SleepDuration is the sleep time for making the next request for log events.
	SleepDuration = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchLogs added in v0.0.8

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

CloudWatchLogs wraps an AWS Cloudwatch Logs client.

func New

New returns a CloudWatchLogs configured against the input session.

func (*CloudWatchLogs) LogGroupExists added in v0.0.8

func (c *CloudWatchLogs) LogGroupExists(logGroupName string) (bool, error)

LogGroupExists returns if a log group exists.

func (*CloudWatchLogs) TaskLogEvents added in v0.0.8

func (c *CloudWatchLogs) TaskLogEvents(logGroupName string, streamLastEventTime map[string]int64, opts ...GetLogEventsOpts) (*LogEventsOutput, error)

TaskLogEvents returns an array of Cloudwatch Logs events.

type Event

type Event struct {
	LogStreamName string `json:"logStreamName"`
	IngestionTime int64  `json:"ingestionTime"`
	Message       string `json:"message"`
	Timestamp     int64  `json:"timestamp"`
}

Event represents a log event.

func (*Event) HumanString

func (l *Event) HumanString() string

HumanString returns the stringified LogEvent struct with human readable format.

func (*Event) JSONString

func (l *Event) JSONString() (string, error)

JSONString returns the stringified LogEvent struct with json format.

type GetLogEventsOpts

type GetLogEventsOpts func(*cloudwatchlogs.GetLogEventsInput)

GetLogEventsOpts sets up optional parameters for LogEvents function.

func WithEndTime

func WithEndTime(endTime int64) GetLogEventsOpts

WithEndTime sets up endTime for GetLogEventsInput

func WithLimit

func WithLimit(limit int) GetLogEventsOpts

WithLimit sets up limit for GetLogEventsInput

func WithStartTime

func WithStartTime(startTime int64) GetLogEventsOpts

WithStartTime sets up startTime for GetLogEventsInput

type LogEventsOutput

type LogEventsOutput struct {
	// Retrieved log events.
	Events []*Event
	// Timestamp for the last event
	LastEventTime map[string]int64
}

LogEventsOutput contains the output for LogEvents

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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