cwsaws

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSingletonClient

func GetSingletonClient[T any](name ClientName, ctx context.Context, clientGenFn func(cfg aws.Config) T, optFns ...func(*config.LoadOptions) error) T

func ProxyProcessLambdaEvent

func ProxyProcessLambdaEvent(ctx context.Context, event events.SQSEvent, processFn func(ctx context.Context, msg types.Message) error) error

Types

type ClientName

type ClientName string
const (
	ClientName_STS        ClientName = "STS"
	ClientName_DynamoDB   ClientName = "DynamoDB"
	ClientName_SQS        ClientName = "SQS"
	ClientName_SNS        ClientName = "SNS"
	ClientName_S3         ClientName = "S3"
	ClientName_SES        ClientName = "SES"
	ClientName_CloudWatch ClientName = "CloudWatch"
)

type CloudWatchLogsProxy added in v0.2.0

type CloudWatchLogsProxy struct {
	*cloudwatchlogs.Client
	Context  *context.Context
	LogGroup string
}

func GetCloudWatchLogProxy added in v0.2.0

func GetCloudWatchLogProxy(logGroup string, ctx context.Context, optFns ...func(*config.LoadOptions) error) CloudWatchLogsProxy

func (*CloudWatchLogsProxy) CreateLogGroup added in v0.2.0

func (p *CloudWatchLogsProxy) CreateLogGroup() error

func (*CloudWatchLogsProxy) CreateLogStream added in v0.2.0

func (p *CloudWatchLogsProxy) CreateLogStream() error

func (*CloudWatchLogsProxy) GetTimedLogStreamName added in v0.2.0

func (p *CloudWatchLogsProxy) GetTimedLogStreamName(interval int) *string

func (*CloudWatchLogsProxy) SendMessage added in v0.2.0

func (p *CloudWatchLogsProxy) SendMessage(message string) error

type DynamoDBTableProxy

type DynamoDBTableProxy[O any] struct {
	*dynamodb.Client
	Context   *context.Context
	TableName string
}

func GetDynamoDBTableProxy

func GetDynamoDBTableProxy[O any](name string, ctx context.Context, optFns ...func(*config.LoadOptions) error) DynamoDBTableProxy[O]

func (*DynamoDBTableProxy[O]) ProxyCreateTableAndWaitActive

func (table *DynamoDBTableProxy[O]) ProxyCreateTableAndWaitActive(input *dynamodb.CreateTableInput) (*dynamodb.CreateTableOutput, error)

func (*DynamoDBTableProxy[O]) ProxyDeleteItem

func (table *DynamoDBTableProxy[O]) ProxyDeleteItem(input *dynamodb.DeleteItemInput) (*O, error)

func (*DynamoDBTableProxy[O]) ProxyDeleteTableAndWait

func (table *DynamoDBTableProxy[O]) ProxyDeleteTableAndWait() (*dynamodb.DeleteTableOutput, error)

func (*DynamoDBTableProxy[O]) ProxyGetItem

func (table *DynamoDBTableProxy[O]) ProxyGetItem(input *dynamodb.GetItemInput) (*O, error)

func (*DynamoDBTableProxy[O]) ProxyPutItem

func (table *DynamoDBTableProxy[O]) ProxyPutItem(input *dynamodb.PutItemInput) (*O, error)

func (*DynamoDBTableProxy[O]) ProxyQuery

func (table *DynamoDBTableProxy[O]) ProxyQuery(input *dynamodb.QueryInput) ([]*O, error)

func (*DynamoDBTableProxy[O]) ProxyQueryBatchUpdate

func (table *DynamoDBTableProxy[O]) ProxyQueryBatchUpdate(input *dynamodb.QueryInput, callback func(item *O, batchRequests *[]types.WriteRequest) *[]types.WriteRequest) *sync.WaitGroup

func (*DynamoDBTableProxy[O]) ProxyScan

func (table *DynamoDBTableProxy[O]) ProxyScan(input *dynamodb.ScanInput) ([]*O, error)

func (*DynamoDBTableProxy[O]) ProxyScanWithCalback

func (table *DynamoDBTableProxy[O]) ProxyScanWithCalback(input *dynamodb.ScanInput, callback func(item *O, batchRequests []types.WriteRequest) []types.WriteRequest) *sync.WaitGroup

func (*DynamoDBTableProxy[O]) ProxyTableHasGSI

func (table *DynamoDBTableProxy[O]) ProxyTableHasGSI(gsiName string) bool

func (*DynamoDBTableProxy[O]) ProxyTableIsActive

func (table *DynamoDBTableProxy[O]) ProxyTableIsActive() bool

func (*DynamoDBTableProxy[O]) ProxyUpdateItem

func (table *DynamoDBTableProxy[O]) ProxyUpdateItem(input *dynamodb.UpdateItemInput) (*O, error)

type S3Proxy

type S3Proxy struct {
	*s3.Client
	Context    context.Context
	BucketName string
	Versioning *bool
	Lock       sync.Mutex
}

func GetS3Proxy

func GetS3Proxy(ctx context.Context, bucketName string) S3Proxy

func (*S3Proxy) IsVersioning

func (p *S3Proxy) IsVersioning() (bool, error)

func (*S3Proxy) ProxyGetObject

func (p *S3Proxy) ProxyGetObject(subPath string, parsingFunc func(content []byte) (any, error)) (any, error)

func (*S3Proxy) ProxyGetObjectVersionId

func (p *S3Proxy) ProxyGetObjectVersionId(subPath string) (string, error)

func (*S3Proxy) ProxyObjectExists

func (p *S3Proxy) ProxyObjectExists(subPath string) bool

func (*S3Proxy) ProxyPutObject

func (p *S3Proxy) ProxyPutObject(subPath string, object []byte) error

type S3ProxyObject

type S3ProxyObject struct {
	Content          any
	VersionId        string
	ExpiredTimeStamp int
	NextVersionCheck int
}

type SESProxy

type SESProxy struct {
	*ses.Client
	Context context.Context
}

func GetSesProxy

func GetSesProxy(ctx context.Context) SESProxy

func (*SESProxy) ProxyGetTemplateMessage

func (p *SESProxy) ProxyGetTemplateMessage(input SESProxyTemplateInput) (string, string, error)

func (*SESProxy) ProxySendEmail

func (p *SESProxy) ProxySendEmail(input *SESProxyEmailInput) (*ses.SendEmailOutput, error)

func (*SESProxy) ProxySendTemplateEmail

func (p *SESProxy) ProxySendTemplateEmail(input *SESProxyTemplateEmailInput) (*ses.SendEmailOutput, error)

type SESProxyEmailInput

type SESProxyEmailInput struct {
	From           mail.Address
	To             []mail.Address
	CC             []mail.Address
	BCC            []mail.Address
	Subject        string
	SubjectCharset string // default: UTF-8
	Body           string
	BodyCharset    string // default: UTF-8
	IsText         bool   // default: html
}

type SESProxyTemplateEmailInput

type SESProxyTemplateEmailInput struct {
	TemplateInput SESProxyTemplateInput
	From          mail.Address
	To            []mail.Address
	CC            []mail.Address
	BCC           []mail.Address
}

type SESProxyTemplateInput

type SESProxyTemplateInput struct {
	TemplateName  string
	SubjectParams map[string]any
	MessageParams map[string]any
	IsText        bool // default: html
}

type SNSProxy

type SNSProxy struct {
	*sns.Client
	Context  context.Context
	Topic    string
	TopicArn string
}

func GetSnsProxy

func GetSnsProxy(ctx context.Context) SNSProxy

func GetSnsProxyWithTopic

func GetSnsProxyWithTopic(ctx context.Context, Topic string) SNSProxy

func (*SNSProxy) ProxySendPhoneNotification

func (s *SNSProxy) ProxySendPhoneNotification(phone string, content string, phases ...any) (*sns.PublishOutput, error)

func (*SNSProxy) ProxySendTemplateNotification

func (s *SNSProxy) ProxySendTemplateNotification(input *SNSProxyTemplateNotificationInput) (*sns.PublishOutput, error)

type SNSProxyTemplateNotificationInput

type SNSProxyTemplateNotificationInput struct {
	TemplateName string
	Phone        string
	Params       []any
}

type SQSProxy

type SQSProxy struct {
	*sqs.Client
	Context   context.Context
	QueueName string
	AccountId string
	QueueArn  string
	QueueUrl  string
	Region    string
	// contains filtered or unexported fields
}

func GetSqsProxy

func GetSqsProxy(ctx context.Context, processFn ...func(ctx context.Context, msg types.Message) error) SQSProxy

func (*SQSProxy) ProxyInitializeByArn

func (proxy *SQSProxy) ProxyInitializeByArn(arn string) error

func (*SQSProxy) ProxyInitializeByName

func (proxy *SQSProxy) ProxyInitializeByName(name string) error

func (*SQSProxy) ProxyProcessNextMessages

func (proxy *SQSProxy) ProxyProcessNextMessages(MaxNumberOfMessages int32) error

type STSProxy

type STSProxy struct {
	*sts.Client
	Context context.Context
	// contains filtered or unexported fields
}

func GetStsClient

func GetStsClient(ctx context.Context) STSProxy

func (*STSProxy) GetAccountId

func (proxy *STSProxy) GetAccountId() (string, error)

Jump to

Keyboard shortcuts

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