awsmanager

package
v0.4.67 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAwsConfig

func GetAwsConfig(ctx context.Context, cfg *AwsCredentialsConfig, opts ...func(*config.LoadOptions) error) (*aws.Config, error)

func IsNotFound

func IsNotFound(err error) bool

Types

type AwsCredentialsConfig

type AwsCredentialsConfig struct {
	Region   string
	Endpoint string

	Profile string
	Id      string
	Secret  string
	Token   string

	Role            string
	RoleExternalId  string
	RoleSessionName string

	UseEc2 bool
}

type DynamoDbClient

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

func NewDynamoDbClient

func NewDynamoDbClient(api dynamoDBAPIV2) *DynamoDbClient

func (*DynamoDbClient) GetTableKey added in v0.4.51

func (d *DynamoDbClient) GetTableKey(ctx context.Context, tableName string) (*DynamoDbTableKey, error)

func (*DynamoDbClient) ListAllTables

func (d *DynamoDbClient) ListAllTables(ctx context.Context, input *dynamodb.ListTablesInput, optFns ...func(*dynamodb.Options)) ([]string, error)

func (*DynamoDbClient) ScanTable added in v0.4.54

func (d *DynamoDbClient) ScanTable(
	ctx context.Context,
	tableName string,
	lastEvaluatedKey map[string]types.AttributeValue,
) (*dynamodb.ScanOutput, error)

type DynamoDbTableKey added in v0.4.51

type DynamoDbTableKey struct {
	HashKey  string
	RangeKey string
}

type MockNeosyncAwsManagerClient

type MockNeosyncAwsManagerClient struct {
	mock.Mock
}

MockNeosyncAwsManagerClient is an autogenerated mock type for the NeosyncAwsManagerClient type

func NewMockNeosyncAwsManagerClient

func NewMockNeosyncAwsManagerClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockNeosyncAwsManagerClient

NewMockNeosyncAwsManagerClient creates a new instance of MockNeosyncAwsManagerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockNeosyncAwsManagerClient) EXPECT

func (*MockNeosyncAwsManagerClient) GetObject

func (_m *MockNeosyncAwsManagerClient) GetObject(ctx context.Context, s3Client *s3.Client, region *string, params *s3.GetObjectInput) (*s3.GetObjectOutput, error)

GetObject provides a mock function with given fields: ctx, s3Client, region, params

func (*MockNeosyncAwsManagerClient) ListObjectsV2

func (_m *MockNeosyncAwsManagerClient) ListObjectsV2(ctx context.Context, s3Client *s3.Client, region *string, params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, error)

ListObjectsV2 provides a mock function with given fields: ctx, s3Client, region, params

func (*MockNeosyncAwsManagerClient) NewDynamoDbClient

NewDynamoDbClient provides a mock function with given fields: ctx, connCfg

func (*MockNeosyncAwsManagerClient) NewS3Client

NewS3Client provides a mock function with given fields: ctx, config

type MockNeosyncAwsManagerClient_Expecter

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

func (*MockNeosyncAwsManagerClient_Expecter) GetObject

func (_e *MockNeosyncAwsManagerClient_Expecter) GetObject(ctx interface{}, s3Client interface{}, region interface{}, params interface{}) *MockNeosyncAwsManagerClient_GetObject_Call

GetObject is a helper method to define mock.On call

  • ctx context.Context
  • s3Client *s3.Client
  • region *string
  • params *s3.GetObjectInput

func (*MockNeosyncAwsManagerClient_Expecter) ListObjectsV2

func (_e *MockNeosyncAwsManagerClient_Expecter) ListObjectsV2(ctx interface{}, s3Client interface{}, region interface{}, params interface{}) *MockNeosyncAwsManagerClient_ListObjectsV2_Call

ListObjectsV2 is a helper method to define mock.On call

  • ctx context.Context
  • s3Client *s3.Client
  • region *string
  • params *s3.ListObjectsV2Input

func (*MockNeosyncAwsManagerClient_Expecter) NewDynamoDbClient

func (_e *MockNeosyncAwsManagerClient_Expecter) NewDynamoDbClient(ctx interface{}, connCfg interface{}) *MockNeosyncAwsManagerClient_NewDynamoDbClient_Call

NewDynamoDbClient is a helper method to define mock.On call

  • ctx context.Context
  • connCfg *mgmtv1alpha1.DynamoDBConnectionConfig

func (*MockNeosyncAwsManagerClient_Expecter) NewS3Client

func (_e *MockNeosyncAwsManagerClient_Expecter) NewS3Client(ctx interface{}, config interface{}) *MockNeosyncAwsManagerClient_NewS3Client_Call

NewS3Client is a helper method to define mock.On call

  • ctx context.Context
  • config *mgmtv1alpha1.AwsS3ConnectionConfig

type MockNeosyncAwsManagerClient_GetObject_Call

type MockNeosyncAwsManagerClient_GetObject_Call struct {
	*mock.Call
}

MockNeosyncAwsManagerClient_GetObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetObject'

func (*MockNeosyncAwsManagerClient_GetObject_Call) Return

func (*MockNeosyncAwsManagerClient_GetObject_Call) Run

func (*MockNeosyncAwsManagerClient_GetObject_Call) RunAndReturn

type MockNeosyncAwsManagerClient_ListObjectsV2_Call

type MockNeosyncAwsManagerClient_ListObjectsV2_Call struct {
	*mock.Call
}

MockNeosyncAwsManagerClient_ListObjectsV2_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListObjectsV2'

func (*MockNeosyncAwsManagerClient_ListObjectsV2_Call) Return

func (*MockNeosyncAwsManagerClient_ListObjectsV2_Call) Run

type MockNeosyncAwsManagerClient_NewDynamoDbClient_Call

type MockNeosyncAwsManagerClient_NewDynamoDbClient_Call struct {
	*mock.Call
}

MockNeosyncAwsManagerClient_NewDynamoDbClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewDynamoDbClient'

func (*MockNeosyncAwsManagerClient_NewDynamoDbClient_Call) Return

func (*MockNeosyncAwsManagerClient_NewDynamoDbClient_Call) Run

type MockNeosyncAwsManagerClient_NewS3Client_Call

type MockNeosyncAwsManagerClient_NewS3Client_Call struct {
	*mock.Call
}

MockNeosyncAwsManagerClient_NewS3Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewS3Client'

func (*MockNeosyncAwsManagerClient_NewS3Client_Call) Return

func (*MockNeosyncAwsManagerClient_NewS3Client_Call) Run

type MockdynamoDBAPIV2

type MockdynamoDBAPIV2 struct {
	mock.Mock
}

MockdynamoDBAPIV2 is an autogenerated mock type for the dynamoDBAPIV2 type

func NewMockdynamoDBAPIV2

func NewMockdynamoDBAPIV2(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockdynamoDBAPIV2

NewMockdynamoDBAPIV2 creates a new instance of MockdynamoDBAPIV2. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockdynamoDBAPIV2) DescribeTable

func (_m *MockdynamoDBAPIV2) DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)

DescribeTable provides a mock function with given fields: ctx, params, optFns

func (*MockdynamoDBAPIV2) EXPECT

func (*MockdynamoDBAPIV2) ListTables

func (_m *MockdynamoDBAPIV2) ListTables(ctx context.Context, params *dynamodb.ListTablesInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ListTablesOutput, error)

ListTables provides a mock function with given fields: ctx, params, optFns

func (*MockdynamoDBAPIV2) Scan

func (_m *MockdynamoDBAPIV2) Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)

Scan provides a mock function with given fields: ctx, params, optFns

type MockdynamoDBAPIV2_DescribeTable_Call

type MockdynamoDBAPIV2_DescribeTable_Call struct {
	*mock.Call
}

MockdynamoDBAPIV2_DescribeTable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeTable'

func (*MockdynamoDBAPIV2_DescribeTable_Call) Return

func (*MockdynamoDBAPIV2_DescribeTable_Call) Run

type MockdynamoDBAPIV2_Expecter

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

func (*MockdynamoDBAPIV2_Expecter) DescribeTable

func (_e *MockdynamoDBAPIV2_Expecter) DescribeTable(ctx interface{}, params interface{}, optFns ...interface{}) *MockdynamoDBAPIV2_DescribeTable_Call

DescribeTable is a helper method to define mock.On call

  • ctx context.Context
  • params *dynamodb.DescribeTableInput
  • optFns ...func(*dynamodb.Options)

func (*MockdynamoDBAPIV2_Expecter) ListTables

func (_e *MockdynamoDBAPIV2_Expecter) ListTables(ctx interface{}, params interface{}, optFns ...interface{}) *MockdynamoDBAPIV2_ListTables_Call

ListTables is a helper method to define mock.On call

  • ctx context.Context
  • params *dynamodb.ListTablesInput
  • optFns ...func(*dynamodb.Options)

func (*MockdynamoDBAPIV2_Expecter) Scan

func (_e *MockdynamoDBAPIV2_Expecter) Scan(ctx interface{}, params interface{}, optFns ...interface{}) *MockdynamoDBAPIV2_Scan_Call

Scan is a helper method to define mock.On call

  • ctx context.Context
  • params *dynamodb.ScanInput
  • optFns ...func(*dynamodb.Options)

type MockdynamoDBAPIV2_ListTables_Call

type MockdynamoDBAPIV2_ListTables_Call struct {
	*mock.Call
}

MockdynamoDBAPIV2_ListTables_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTables'

func (*MockdynamoDBAPIV2_ListTables_Call) Return

func (*MockdynamoDBAPIV2_ListTables_Call) Run

func (*MockdynamoDBAPIV2_ListTables_Call) RunAndReturn

type MockdynamoDBAPIV2_Scan_Call

type MockdynamoDBAPIV2_Scan_Call struct {
	*mock.Call
}

MockdynamoDBAPIV2_Scan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Scan'

func (*MockdynamoDBAPIV2_Scan_Call) Return

func (*MockdynamoDBAPIV2_Scan_Call) Run

func (_c *MockdynamoDBAPIV2_Scan_Call) Run(run func(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options))) *MockdynamoDBAPIV2_Scan_Call

func (*MockdynamoDBAPIV2_Scan_Call) RunAndReturn

type NeosyncAwsManager

type NeosyncAwsManager struct {
}

func New

func New() *NeosyncAwsManager

func (*NeosyncAwsManager) GetObject

func (n *NeosyncAwsManager) GetObject(
	ctx context.Context,
	s3Client *s3.Client,
	region *string,
	params *s3.GetObjectInput,
) (*s3.GetObjectOutput, error)

func (*NeosyncAwsManager) ListObjectsV2

func (n *NeosyncAwsManager) ListObjectsV2(
	ctx context.Context,
	s3Client *s3.Client,
	region *string,
	params *s3.ListObjectsV2Input,
) (*s3.ListObjectsV2Output, error)

func (*NeosyncAwsManager) NewDynamoDbClient

Returns a wrapper dynamodb client

func (*NeosyncAwsManager) NewS3Client

type NeosyncAwsManagerClient

type NeosyncAwsManagerClient interface {
	NewS3Client(ctx context.Context, config *mgmtv1alpha1.AwsS3ConnectionConfig) (*s3.Client, error)
	ListObjectsV2(
		ctx context.Context,
		s3Client *s3.Client,
		region *string,
		params *s3.ListObjectsV2Input,
	) (*s3.ListObjectsV2Output, error)
	GetObject(
		ctx context.Context,
		s3Client *s3.Client,
		region *string,
		params *s3.GetObjectInput,
	) (*s3.GetObjectOutput, error)

	NewDynamoDbClient(ctx context.Context, connCfg *mgmtv1alpha1.DynamoDBConnectionConfig) (*DynamoDbClient, error)
}

Jump to

Keyboard shortcuts

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