aws

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 13 Imported by: 3

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

	InsecureSkipVerify bool
}

NewConfigOptions is the configuration options.

type NewS3ClientOptions

type NewS3ClientOptions struct {
	EndpointURL string
	Region      string

	UseAnonymousCredentials bool

	AssumeRole *AssumeRole

	InsecureSkipVerify bool
}

NewS3ClientOptions is the options for NewS3Client.

Jump to

Keyboard shortcuts

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