Documentation ¶
Overview ¶
Package aws contains utilites for Amazon Web Services.
Index ¶
- Constants
- func NewEventExporter(client *sqs.SQS, queueURL *string) fossilizer.EventExporter
- func NewFossilsQueue(client *sqs.SQS, queueURL *string) fossilizer.FossilsQueue
- func NewSession(region string) (*session.Session, error)
- func RegisterFlags()
- func SessionFromFlags() *session.Session
- type EventExporter
- type FossilsQueue
Constants ¶
const (
// ExporterComponent name for monitoring.
ExporterComponent = "EventExporter"
)
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 ¶
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 SessionFromFlags ¶
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.