aws

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package aws provides a complete API to work with different services of Amazon Web Services (defined as AWS).

Specifications leveraged:

  • Bucket (via S3)
  • NoSQL (via DynamoDB)
  • Topic (via SNS/SQS)

Index

Constants

View Source
const Integration string = "aws"

Integration is the string representation of the AWS integration.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// Integration represents the common config shared across all integrations.
	Integration integration.Config `json:"integration"`
}

Config is the configuration an end-user should set to configure the AWS integration.

func (*Config) Validate

func (config *Config) Validate() error

Validate validates the config passed by the end-user. It returns an error if anything critical occured.

type Handler

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

Handler handles the AWS integration and gives access to related workflows and activities.

func New

func New(ctx context.Context, config Config) (*Handler, error)

New returns a new aws Handler. It applies the configuration passed by the end-user.

func (*Handler) Close

func (h *Handler) Close() error

Close closes the integration and the specifications registered by the end-user. An error is returned in case the Handler has already been closed.

func (*Handler) Config added in v0.12.0

func (h *Handler) Config() integration.Config

Config returns the common integration's Config, which is the Config shared by all integrations.

func (*Handler) ConfigMap

func (h *Handler) ConfigMap() map[string]any

ConfigMap transforms the configuration to a map, including a "specifications" key with the configuration for each specification configured.

func (*Handler) Init

func (h *Handler) Init() error

Init initializes the integration and specifications the end-user wants to use. An error is returned in case the Handler has already been initialized.

func (*Handler) IsReady

func (h *Handler) IsReady() bool

IsReady returns if the integration is ready to be consumed by the end-user. The integration must be initialized and must not be closed. This also ensures the specifications leveraged are ready to be consumed. If one of them is not, the integration would not be ready.

func (*Handler) ListActivities

func (h *Handler) ListActivities() []string

ListActivities returns a sorted list of activities' name registered by the integration (and the specifications leveraged if applicable).

func (*Handler) ListWorkflows

func (h *Handler) ListWorkflows() []string

ListWorkflows returns a sorted list of workflows' name registered by the integration (and the specifications leveraged if applicable).

func (*Handler) RegisterWithBucket

func (h *Handler) RegisterWithBucket(w worker.Worker, config bucket.Config) error

RegisterWithBucket registers the bucket specification within the AWS integration. This leverages S3. End-users will have access to workflows and activities exposed by the bucket specification.

func (*Handler) RegisterWithNoSQL

func (h *Handler) RegisterWithNoSQL(w worker.Worker, config nosql.Config) error

RegisterWithNoSQL registers the NoSQL specification within the AWS integration. This leverages DynamoDB. End-users will have access to workflows and activities exposed by the NoSQL specification.

DynamoDB allows the following Params in nosql.Config:

  • sort_key (optional): The path to the sort key of a table or an index.
  • allow_scans (optional): If "true", allow table scans to be used for queries.
  • consistent_read (optional): If "true", a strongly consistent read is used whenever possible.

func (*Handler) RegisterWithTopic

func (h *Handler) RegisterWithTopic(w worker.Worker, config topic.Config) error

RegisterWithTopic registers the topic specification within the AWS integration. This leverages SNS/SQS. End-users will have access to workflows and activities exposed by the topic specification.

The Topic to use in topic.Config is the complete AWS ARN of the SNS or SQS to use. Example:

topic.Config{
  Topic: "arn:aws:sns:us-east-2:123456789012:my-topic",
}

func (*Handler) String

func (h *Handler) String() string

String returns the string representation of the integration.

Jump to

Keyboard shortcuts

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