cloudwatchlogspublisher

package
v0.0.0-...-a9ed6da Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cloudwatchlogspublisher is responsible for pulling logs from the log queue and publishing them to cloudwatch

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudWatchLogsService

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

CloudWatchLogsService encapsulates the client and stop policy as a wrapper to call the cloudwatchlogs API

func NewCloudWatchLogsService

func NewCloudWatchLogsService() *CloudWatchLogsService

NewCloudWatchLogsService Creates a new instance of the CloudWatchLogsService

func NewCloudWatchLogsServiceWithCredentials

func NewCloudWatchLogsServiceWithCredentials(id, secret string) *CloudWatchLogsService

NewCloudWatchLogsServiceWithCredentials Creates a new instance of the CloudWatchLogsService using credentials from the Id and Secret passed

func (*CloudWatchLogsService) CreateLogGroup

func (service *CloudWatchLogsService) CreateLogGroup(log log.T, logGroup string) (err error)

CreateLogGroup calls the CreateLogGroup API to create a log group

func (*CloudWatchLogsService) CreateLogStream

func (service *CloudWatchLogsService) CreateLogStream(log log.T, logGroup, logStream string) (err error)

CreateLogStream calls the CreateLogStream API to create log stream within the specified log group

func (*CloudWatchLogsService) CreateNewServiceIfUnHealthy

func (service *CloudWatchLogsService) CreateNewServiceIfUnHealthy()

CreateNewServiceIfUnHealthy checks service healthy and create new service if original is unhealthy

func (*CloudWatchLogsService) DescribeLogGroups

func (service *CloudWatchLogsService) DescribeLogGroups(log log.T, logGroupPrefix, nextToken string) (response *cloudwatchlogs.DescribeLogGroupsOutput, err error)

DescribeLogGroups calls the DescribeLogGroups API to get the details of log groups of account

func (*CloudWatchLogsService) DescribeLogStreams

func (service *CloudWatchLogsService) DescribeLogStreams(log log.T, logGroup, logStreamPrefix, nextToken string) (response *cloudwatchlogs.DescribeLogStreamsOutput, err error)

DescribeLogStreams calls the DescribeLogStreams API to get the details of the log streams present

func (*CloudWatchLogsService) GetSequenceTokenForStream

func (service *CloudWatchLogsService) GetSequenceTokenForStream(log log.T, logGroupName, logStreamName string) (sequenceToken *string)

GetSequenceTokenForStream returns the current sequence token for the stream specified

func (*CloudWatchLogsService) IsLogGroupPresent

func (service *CloudWatchLogsService) IsLogGroupPresent(log log.T, logGroup string) bool

IsLogGroupPresent checks and returns true when the log group is present

func (*CloudWatchLogsService) IsLogStreamPresent

func (service *CloudWatchLogsService) IsLogStreamPresent(log log.T, logGroupName, logStreamName string) bool

IsLogStreamPresent checks and returns true when the log stream is present

func (*CloudWatchLogsService) PutLogEvents

func (service *CloudWatchLogsService) PutLogEvents(log log.T, messages []*cloudwatchlogs.InputLogEvent, logGroup, logStream string, sequenceToken *string) (nextSequenceToken *string, err error)

PutLogEvents calls the PutLogEvents API to push messages to CloudWatchLogs

type CloudWatchPublisher

type CloudWatchPublisher struct {
	QueuePollingInterval time.Duration // The interval after which the publisher polls the queue
	QueuePollingWaitTime time.Duration // The duration for which the publisher blocks while polling. For negative value will wait until enqueue
	// contains filtered or unexported fields
}

CloudWatchPublisher wrapper to publish logs to cloudwatchlogs

func (*CloudWatchPublisher) CloudWatchLogsEventsListener

func (cloudwatchPublisher *CloudWatchPublisher) CloudWatchLogsEventsListener()

CloudWatchLogsEventsListener listens to cloudwatchlogs events channel

func (*CloudWatchPublisher) Init

func (cloudwatchPublisher *CloudWatchPublisher) Init(log log.T)

Init initializes the publisher

func (*CloudWatchPublisher) Start

func (cloudwatchPublisher *CloudWatchPublisher) Start()

Start starts the publisher to consume messages from the queue

func (*CloudWatchPublisher) Stop

func (cloudwatchPublisher *CloudWatchPublisher) Stop()

Stop called to stop the publisher

type ICloudWatchPublisher

type ICloudWatchPublisher interface {
	Init(log log.T) (err error)
	Start()
	Stop()
}

ICloudWatchPublisher interface for publishing logs to cloudwatchlogs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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