aws

package
v0.0.0-...-c2b5c71 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package aws provides a mockable client for interacting with AWS. revive:disable:unexported-return

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, creds *Credentials) (*awsClient, error)

NewClient returns a new AWS client, that implements the Client interface.

Types

type Client

type Client interface {
	//S3
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
	PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
	DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error)
	ListObjectsV2(ctx context.Context, params *s3.ListObjectsV2Input, optFns ...func(*s3.Options)) (*s3.ListObjectsV2Output, error)
}

Client is a wrapper object for actual AWS SDK clients to allow for easier testing.

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	DefaultRegion   string
}

Credentials holds the AWS credentials that can be used with awsclient.NewClient

func GetAwsCredentials

func GetAwsCredentials(ctx context.Context, vc *vault.Client) (*Credentials, error)

GetAwsCredentials returns AWS credentials from the environment or from vault

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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