aws

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 6 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt added in v0.11.0

func Decrypt(ctx context.Context, data []byte, name string, dataKey []byte) (string, error)

Decrypt decrypts into a string data.

func Encrypt added in v0.11.0

func Encrypt(ctx context.Context, data, name string, dataKey []byte) ([]byte, error)

Encrypt encrypts a string data.

func NewConfig added in v0.11.0

func NewConfig(ctx context.Context, o NewConfigOptions) (aws.Config, error)

NewConfig returns a new configuration.

func NewS3Client

func NewS3Client(ctx context.Context, o NewS3ClientOptions) (*s3.Client, error)

NewS3Client returns a new S3 client.

Types

type AssumeRole

type AssumeRole struct {
	RoleARN    string
	ExternalID string
}

AssumeRole is the options for AssumeRole.

type KMSClient added in v0.11.0

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

KMSClient maintains the client to access AWS KMS related service.

func NewKMSClient added in v0.11.0

func NewKMSClient(ctx context.Context, o NewConfigOptions, keyAlias string) (*KMSClient, error)

NewKMSClient construct a KMS client.

func (*KMSClient) CreateDataKey added in v0.11.0

func (c *KMSClient) CreateDataKey(ctx context.Context) ([]byte, []byte, error)

CreateDataKey creates a data key with KMS master key.

func (*KMSClient) DecryptDataKey added in v0.11.0

func (c *KMSClient) DecryptDataKey(ctx context.Context, encryptedKey []byte) ([]byte, error)

DecryptDataKey decrypts the data key with KMS master key.

type MockKMSClient added in v0.11.0

type MockKMSClient struct {
	// DataKey is the data key used for testing. It is exposed,
	// in case the test needs to refer/overwrite it.
	DataKey []byte
}

MockKMSClient is a mock implementation of KMSClient.

func NewMockKMSClient added in v0.11.0

func NewMockKMSClient() *MockKMSClient

NewMockKMSClient creates a new MockClient with a default data key.

func (*MockKMSClient) CreateDataKey added in v0.11.0

func (m *MockKMSClient) CreateDataKey(ctx context.Context) ([]byte, []byte, error)

CreateDataKey implements a DataKeyManagementClient method.

func (*MockKMSClient) DecryptDataKey added in v0.11.0

func (m *MockKMSClient) DecryptDataKey(ctx context.Context, encryptedKey []byte) ([]byte, error)

DecryptDataKey implements a DataKeyManagementClient method.

type NewConfigOptions added in v0.11.0

type NewConfigOptions struct {
	Region string

	UseAnonymousCredentials bool

	AssumeRole *AssumeRole
	Secret     *Secret

	InsecureSkipVerify bool
}

NewConfigOptions is the configuration options.

type NewS3ClientOptions

type NewS3ClientOptions struct {
	EndpointURL string
	Region      string

	UseAnonymousCredentials bool

	AssumeRole *AssumeRole
	Secret     *Secret

	InsecureSkipVerify bool
}

NewS3ClientOptions is the options for NewS3Client.

type Secret added in v0.20.0

type Secret struct {
	AccessKeyID     string
	SecretAccessKey string
}

Secret is the AWS secret.

Jump to

Keyboard shortcuts

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