clients

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultClient

func SetDefaultClient(ctx context.Context, client Client)

SetDefaultClient sets the provided client as the singleton client

func TableName

func TableName(ctx context.Context) string

TableName returns the name of the DynamoDB table.

Types

type Client

type Client struct {
	Config aws.Config
	// contains filtered or unexported fields
}

Client is the primary export of this module

func GetDefaultClient

func GetDefaultClient(ctx context.Context) *Client

GetDefaultClient returns the singleton client. If the singleton client does not exist, it will be created using the default config

func NewClientFromSTSCredentials

func NewClientFromSTSCredentials(ctx context.Context, accessKeyID, secretAccessKey, sessionToken string) Client

NewClientFromSTSCredentials creates a new client appropriate for use when you have short term STS credentials like accessKeyID, secretAccessKey, and sessionToken.

func NewFromConfig

func NewFromConfig(ctx context.Context, cfg aws.Config) Client

NewFromConfig creates a new client when you have a custom config that you want to use.

func NewLongTermCredentialClient

func NewLongTermCredentialClient(ctx context.Context, accessKeyID, secretAccessKey string) Client

NewLongTermCredentialClient creates a new client appropriate for use when you have long term credentials

func (*Client) Dynamo

func (c *Client) Dynamo() DynamoMethods

Dynamo returns the Dynamo client, or creates one if one doesnt exist

func (*Client) EventBridge

func (c *Client) EventBridge() *eventbridge.Client

EventBridge returns the EventBridge client, or creates one if one doesnt exist

func (*Client) S3

func (c *Client) S3() *awsS3.Client

S3 returns the s3 client, or creates one if one doesnt exist

func (*Client) SQS

func (c *Client) SQS() *sqs.Client

SQS returns the SQS client, or creates one if one doesnt exist

func (*Client) TableName

func (c *Client) TableName(ctx context.Context) string

TableName returns the name of the DynamoDB table.

func (Client) WithConfig

func (c Client) WithConfig(cfg aws.Config) Client

func (Client) WithTableName

func (c Client) WithTableName(tablename string) Client

type DynamoMethods

type DynamoMethods interface {
	GetItem(ctx context.Context, in *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, in *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	DeleteItem(ctx context.Context, in *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
	Query(ctx context.Context, in *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
	UpdateItem(ctx context.Context, in *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
}

Jump to

Keyboard shortcuts

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