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 ¶
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 ¶
func New(s *session.Session) *CloudWatchLogs
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 ¶
HumanString returns the stringified LogEvent struct with human readable format.
func (*Event) JSONString ¶
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