client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAWSConfig added in v0.7.0

func LoadAWSConfig(ctx context.Context, region string, profile string) (aws.Config, error)

func WaitForRetry

func WaitForRetry(retryCount int, sleepTimeSec int, targetResource *string, err error) error

Types

type Backup

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

func NewBackup

func NewBackup(client IBackupSDKClient) *Backup

func (*Backup) CheckBackupVaultExists

func (backupClient *Backup) CheckBackupVaultExists(ctx context.Context, backupVaultName *string) (bool, error)

func (*Backup) DeleteBackupVault

func (backupClient *Backup) DeleteBackupVault(ctx context.Context, backupVaultName *string) error

func (*Backup) DeleteRecoveryPoint

func (backupClient *Backup) DeleteRecoveryPoint(ctx context.Context, backupVaultName *string, recoveryPointArn *string) error

func (*Backup) DeleteRecoveryPoints

func (backupClient *Backup) DeleteRecoveryPoints(ctx context.Context, backupVaultName *string, recoveryPoints []types.RecoveryPointByBackupVault) error

func (*Backup) ListRecoveryPointsByBackupVault

func (backupClient *Backup) ListRecoveryPointsByBackupVault(ctx context.Context, backupVaultName *string) ([]types.RecoveryPointByBackupVault, error)

type CloudFormation

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

func (*CloudFormation) DeleteStack

func (cfnClient *CloudFormation) DeleteStack(ctx context.Context, stackName *string, retainResources []string) error

func (*CloudFormation) DescribeStacks

func (cfnClient *CloudFormation) DescribeStacks(ctx context.Context, stackName *string) (*cloudformation.DescribeStacksOutput, bool, error)

func (*CloudFormation) ListStackResources

func (cfnClient *CloudFormation) ListStackResources(ctx context.Context, stackName *string) ([]types.StackResourceSummary, error)

func (*CloudFormation) ListStacks added in v0.7.0

func (cfnClient *CloudFormation) ListStacks(ctx context.Context) ([]types.StackSummary, error)

type Ecr

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

func NewEcr

func NewEcr(client IEcrSDKClient) *Ecr

func (*Ecr) CheckEcrExists

func (ecrClient *Ecr) CheckEcrExists(ctx context.Context, repositoryName *string) (bool, error)

func (*Ecr) DeleteRepository

func (ecrClient *Ecr) DeleteRepository(ctx context.Context, repositoryName *string) error

type IBackup

type IBackup interface {
	ListRecoveryPointsByBackupVault(ctx context.Context, backupVaultName *string) ([]types.RecoveryPointByBackupVault, error)
	DeleteRecoveryPoints(ctx context.Context, backupVaultName *string, recoveryPoints []types.RecoveryPointByBackupVault) error
	DeleteRecoveryPoint(ctx context.Context, backupVaultName *string, recoveryPointArn *string) error
	DeleteBackupVault(ctx context.Context, backupVaultName *string) error
	CheckBackupVaultExists(ctx context.Context, backupVaultName *string) (bool, error)
}

type IBackupSDKClient

type IBackupSDKClient interface {
	ListRecoveryPointsByBackupVault(ctx context.Context, params *backup.ListRecoveryPointsByBackupVaultInput, optFns ...func(*backup.Options)) (*backup.ListRecoveryPointsByBackupVaultOutput, error)
	DeleteRecoveryPoint(ctx context.Context, params *backup.DeleteRecoveryPointInput, optFns ...func(*backup.Options)) (*backup.DeleteRecoveryPointOutput, error)
	DeleteBackupVault(ctx context.Context, params *backup.DeleteBackupVaultInput, optFns ...func(*backup.Options)) (*backup.DeleteBackupVaultOutput, error)
	ListBackupVaults(ctx context.Context, params *backup.ListBackupVaultsInput, optFns ...func(*backup.Options)) (*backup.ListBackupVaultsOutput, error)
}

type ICloudFormation

type ICloudFormation interface {
	DeleteStack(ctx context.Context, stackName *string, retainResources []string) error
	DescribeStacks(ctx context.Context, stackName *string) (*cloudformation.DescribeStacksOutput, bool, error)
	ListStackResources(ctx context.Context, stackName *string) ([]types.StackResourceSummary, error)
	ListStacks(ctx context.Context) ([]types.StackSummary, error)
}

type ICloudFormationSDKWaiter

type ICloudFormationSDKWaiter interface {
	Wait(ctx context.Context, params *cloudformation.DescribeStacksInput, maxWaitDur time.Duration, optFns ...func(*cloudformation.StackDeleteCompleteWaiterOptions)) error
}

type IEcr

type IEcr interface {
	DeleteRepository(ctx context.Context, repositoryName *string) error
	CheckEcrExists(ctx context.Context, repositoryName *string) (bool, error)
}

type IEcrSDKClient

type IEcrSDKClient interface {
	DeleteRepository(ctx context.Context, params *ecr.DeleteRepositoryInput, optFns ...func(*ecr.Options)) (*ecr.DeleteRepositoryOutput, error)
	DescribeRepositories(ctx context.Context, params *ecr.DescribeRepositoriesInput, optFns ...func(*ecr.Options)) (*ecr.DescribeRepositoriesOutput, error)
}

type IIam

type IIam interface {
	DeleteRole(ctx context.Context, roleName *string, sleepTimeSec int) error
	ListAttachedRolePolicies(ctx context.Context, roleName *string) ([]types.AttachedPolicy, error)
	DetachRolePolicies(ctx context.Context, roleName *string, policies []types.AttachedPolicy, sleepTimeSec int) error
	DetachRolePolicy(ctx context.Context, roleName *string, PolicyArn *string, sleepTimeSec int) error
	CheckRoleExists(ctx context.Context, roleName *string) (bool, error)
}

type IIamSDKClient

type IIamSDKClient interface {
	DeleteRole(ctx context.Context, params *iam.DeleteRoleInput, optFns ...func(*iam.Options)) (*iam.DeleteRoleOutput, error)
	ListAttachedRolePolicies(ctx context.Context, params *iam.ListAttachedRolePoliciesInput, optFns ...func(*iam.Options)) (*iam.ListAttachedRolePoliciesOutput, error)
	DetachRolePolicy(ctx context.Context, params *iam.DetachRolePolicyInput, optFns ...func(*iam.Options)) (*iam.DetachRolePolicyOutput, error)
	GetRole(ctx context.Context, params *iam.GetRoleInput, optFns ...func(*iam.Options)) (*iam.GetRoleOutput, error)
}

type IS3

type IS3 interface {
	DeleteBucket(ctx context.Context, bucketName *string) error
	DeleteObjects(ctx context.Context, bucketName *string, objects []types.ObjectIdentifier, sleepTimeSec int) ([]types.Error, error)
	ListObjectVersions(ctx context.Context, bucketName *string) ([]types.ObjectIdentifier, error)
	CheckBucketExists(ctx context.Context, bucketName *string) (bool, error)
}

type IS3SDKClient

type IS3SDKClient interface {
	DeleteBucket(ctx context.Context, params *s3.DeleteBucketInput, optFns ...func(*s3.Options)) (*s3.DeleteBucketOutput, error)
	DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error)
	ListObjectVersions(ctx context.Context, params *s3.ListObjectVersionsInput, optFns ...func(*s3.Options)) (*s3.ListObjectVersionsOutput, error)
	ListBuckets(ctx context.Context, params *s3.ListBucketsInput, optFns ...func(*s3.Options)) (*s3.ListBucketsOutput, error)
}

type Iam

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

func NewIam

func NewIam(client IIamSDKClient) *Iam

func (*Iam) CheckRoleExists

func (iamClient *Iam) CheckRoleExists(ctx context.Context, roleName *string) (bool, error)

func (*Iam) DeleteRole

func (iamClient *Iam) DeleteRole(ctx context.Context, roleName *string, sleepTimeSec int) error

func (*Iam) DetachRolePolicies

func (iamClient *Iam) DetachRolePolicies(ctx context.Context, roleName *string, policies []types.AttachedPolicy, sleepTimeSec int) error

func (*Iam) DetachRolePolicy

func (iamClient *Iam) DetachRolePolicy(ctx context.Context, roleName *string, PolicyArn *string, sleepTimeSec int) error

func (*Iam) ListAttachedRolePolicies

func (iamClient *Iam) ListAttachedRolePolicies(ctx context.Context, roleName *string) ([]types.AttachedPolicy, error)

type S3

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

func NewS3

func NewS3(client IS3SDKClient) *S3

func (*S3) CheckBucketExists

func (s3Client *S3) CheckBucketExists(ctx context.Context, bucketName *string) (bool, error)

func (*S3) DeleteBucket

func (s3Client *S3) DeleteBucket(ctx context.Context, bucketName *string) error

func (*S3) DeleteObjects

func (s3Client *S3) DeleteObjects(ctx context.Context, bucketName *string, objects []types.ObjectIdentifier, sleepTimeSec int) ([]types.Error, error)

func (*S3) ListObjectVersions

func (s3Client *S3) ListObjectVersions(ctx context.Context, bucketName *string) ([]types.ObjectIdentifier, error)

Jump to

Keyboard shortcuts

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