aws

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package aws contains utilites for Amazon Web Services.

Index

Constants

View Source
const (
	// ExporterComponent name for monitoring.
	ExporterComponent = "EventExporter"
)
View Source
const (

	// QueueComponent name for monitoring.
	QueueComponent = "FossilsQueue"
)

Variables

This section is empty.

Functions

func NewEventExporter

func NewEventExporter(client *sqs.SQS, queueURL *string) fossilizer.EventExporter

NewEventExporter creates a new event exporter that sends events to a queue.

func NewFossilsQueue

func NewFossilsQueue(client *sqs.SQS, queueURL *string) fossilizer.FossilsQueue

NewFossilsQueue connects to the given AWS SQS queue.

func NewSession

func NewSession(region string) (*session.Session, error)

NewSession creates a new session in the given AWS region. If you run locally, you need valid credentials in the ~/.aws folder or in your environment variables. If you run on an AWS EC2 instance of inside ECS, you just need to configure an IAM role for your instance that has the necessary permissions and credentials will be fetched automatically.

func RegisterFlags

func RegisterFlags()

RegisterFlags registers the flags used by AWS components.

func SessionFromFlags

func SessionFromFlags() *session.Session

SessionFromFlags returns an AWS session from command-line flags.

Types

type EventExporter

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

EventExporter exports fossilizer events to an AWS queue.

func (*EventExporter) Push

func (e *EventExporter) Push(ctx context.Context, event *fossilizer.Event) (err error)

Push an event to the queue.

type FossilsQueue

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

FossilsQueue implements a fossils queue backed by AWS SQS.

func (*FossilsQueue) Pop

func (q *FossilsQueue) Pop(ctx context.Context, count int) ([]*fossilizer.Fossil, error)

Pop fossils from the queue.

func (*FossilsQueue) Push

func (q *FossilsQueue) Push(ctx context.Context, f *fossilizer.Fossil) (err error)

Push a fossil to the queue.

Jump to

Keyboard shortcuts

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