testing

package
v0.50.5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Region is the test region of the bucket
	Region = "us-east-1"

	// BucketName is the name of the s3 bucket in testing
	BucketName = "test.bucket.name"
)

Functions

func Bucket

func Bucket(m ...BucketModifier) *v1beta1.Bucket

Bucket creates a v1beta1 Bucket for use in testing

func Client

func Client(m ...ClientModifier) *fake.MockBucketClient

Client creates a MockBucketClient with default request functions and an optional list of ClientModifiers

Types

type BucketModifier

type BucketModifier func(bucket *v1beta1.Bucket)

BucketModifier is a function which modifies the Bucket for testing

func WithAccelerationConfig

func WithAccelerationConfig(s *v1beta1.AccelerateConfiguration) BucketModifier

WithAccelerationConfig sets the AccelerateConfiguration for an S3 Bucket

func WithArn

func WithArn(arn string) BucketModifier

WithArn sets the ARN for an S3 Bucket

func WithCORSConfig

func WithCORSConfig(s *v1beta1.CORSConfiguration) BucketModifier

WithCORSConfig sets the CORSConfiguration for an S3 Bucket

func WithConditions

func WithConditions(c ...xpv1.Condition) BucketModifier

WithConditions sets the Conditions for an S3 Bucket

func WithLifecycleConfig

func WithLifecycleConfig(s *v1beta1.BucketLifecycleConfiguration) BucketModifier

WithLifecycleConfig sets the BucketLifecycleConfiguration for an S3 Bucket

func WithLoggingConfig

func WithLoggingConfig(s *v1beta1.LoggingConfiguration) BucketModifier

WithLoggingConfig sets the LoggingConfiguration for an S3 Bucket

func WithNotificationConfig

func WithNotificationConfig(s *v1beta1.NotificationConfiguration) BucketModifier

WithNotificationConfig sets the NotificationConfiguration for an S3 Bucket

func WithPayerConfig

func WithPayerConfig(s *v1beta1.PaymentConfiguration) BucketModifier

WithPayerConfig sets the PaymentConfiguration for an S3 Bucket

func WithPolicy added in v0.38.0

func WithPolicy(s *common.BucketPolicyBody) BucketModifier

WithPolicy sets the policy for an S3 Bucket

func WithPolicyUpdatePolicy added in v0.38.0

func WithPolicyUpdatePolicy(s *v1beta1.BucketPolicyUpdatePolicy) BucketModifier

WithPolicyUpdatePolicy sets BucketPolicyUpdatePolicy for an S3 Bucket.

func WithReplConfig

WithReplConfig sets the ReplicationConfiguration for an S3 Bucket

func WithSSEConfig

WithSSEConfig sets the ServerSideEncryptionConfiguration for an S3 Bucket

func WithTaggingConfig

func WithTaggingConfig(s *v1beta1.Tagging) BucketModifier

WithTaggingConfig sets the Tagging for an S3 Bucket

func WithVersioningConfig

func WithVersioningConfig(s *v1beta1.VersioningConfiguration) BucketModifier

WithVersioningConfig sets the VersioningConfiguration for an S3 Bucket

func WithWebConfig

WithWebConfig sets the WebsiteConfiguration for an S3 Bucket

type ClientModifier

type ClientModifier func(client *fake.MockBucketClient)

ClientModifier is a function which modifies the S3 Client for testing

func WithCreateBucket

func WithCreateBucket(input func(ctx context.Context, input *awss3.CreateBucketInput, opts []func(*awss3.Options)) (*awss3.CreateBucketOutput, error)) ClientModifier

WithCreateBucket sets the MockCreateBucketRequest of the mock S3 Client

func WithDeleteOwnershipControls added in v0.29.0

func WithDeleteOwnershipControls(input func(ctx context.Context, input *awss3.DeleteBucketOwnershipControlsInput, opts []func(*awss3.Options)) (*awss3.DeleteBucketOwnershipControlsOutput, error)) ClientModifier

WithDeleteOwnershipControls sets the MockDeleteBucketOwnershipControlsRequest of the mock S3 Client

func WithDeleteSSE

func WithDeleteSSE(input func(ctx context.Context, input *awss3.DeleteBucketEncryptionInput, opts []func(*awss3.Options)) (*awss3.DeleteBucketEncryptionOutput, error)) ClientModifier

WithDeleteSSE sets the MockDeleteBucketEncryptionRequest of the mock S3 Client

func WithGetRequestPayment

func WithGetRequestPayment(input func(ctx context.Context, input *awss3.GetBucketRequestPaymentInput, opts []func(*awss3.Options)) (*awss3.GetBucketRequestPaymentOutput, error)) ClientModifier

WithGetRequestPayment sets the MockGetBucketRequestPaymentRequest of the mock S3 Client

func WithGetSSE

func WithGetSSE(input func(ctx context.Context, input *awss3.GetBucketEncryptionInput, opts []func(*awss3.Options)) (*awss3.GetBucketEncryptionOutput, error)) ClientModifier

WithGetSSE sets the MockGetBucketEncryptionRequest of the mock S3 Client

func WithPutACL

func WithPutACL(input func(ctx context.Context, input *awss3.PutBucketAclInput, opts []func(*awss3.Options)) (*awss3.PutBucketAclOutput, error)) ClientModifier

WithPutACL sets the MockPutBucketAclRequest of the mock S3 Client

func WithPutOwnershipControls added in v0.29.0

func WithPutOwnershipControls(input func(ctx context.Context, input *awss3.PutBucketOwnershipControlsInput, opts []func(*awss3.Options)) (*awss3.PutBucketOwnershipControlsOutput, error)) ClientModifier

WithPutOwnershipControls sets the MockPutBucketOwnershipControlsRequest of the mock S3 Client

func WithPutRequestPayment

func WithPutRequestPayment(input func(ctx context.Context, input *awss3.PutBucketRequestPaymentInput, opts []func(*awss3.Options)) (*awss3.PutBucketRequestPaymentOutput, error)) ClientModifier

WithPutRequestPayment sets the MockPutBucketRequestPaymentRequest of the mock S3 Client

Jump to

Keyboard shortcuts

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