Documentation ¶
Index ¶
- func InitializeContext(ctx context.Context) context.Context
- type ContextKey
- type CreatedBucket
- type CreatedDocument
- type Logger
- type Session
- func (s *Session) CleanUp(ctx context.Context)
- func (s *Session) CreateS3Bucket(ctx context.Context, bucket string) error
- func (s *Session) DeleteS3Bucket(ctx context.Context, bucket string) error
- func (s *Session) DeleteS3File(ctx context.Context, bucket, key string) error
- func (s *Session) NewS3Session(ctx context.Context) error
- func (s *Session) UploadS3FileWithContent(ctx context.Context, bucket, key, message string) error
- func (s *Session) ValidateS3BucketExists(ctx context.Context, bucket string) error
- func (s *Session) ValidateS3FileExists(ctx context.Context, bucket, key string) error
- func (s *Session) ValidateS3FileExistsWithContent(ctx context.Context, bucket, key, message string) error
- type Steps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey defines a type to store the s3 session in context.Context.
type CreatedBucket ¶
type CreatedBucket struct {
// contains filtered or unexported fields
}
type CreatedDocument ¶
type CreatedDocument struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logs the s3 operations in a configurable file.
func GetLogger ¶
func GetLogger() *Logger
GetLogger returns the logger for s3 operations. If the logger is not created yet, it creates a new instance of Logger.
func NewLogger ¶
NewLogger creates an instance of the logger. It configures the file path where the s3 operations are logged.
func (Logger) LogOperation ¶
Log a S3 operation
type Session ¶
type Session struct { Client *aws_s.Session CreatedBuckets []*CreatedBucket CreatedDocuments []*CreatedDocument }
func GetSession ¶
GetSession returns the s3 session stored in context. Note that the context should be previously initialized with InitializeContext function.
func (*Session) CreateS3Bucket ¶
CreateS3Bucket creates a new bucket.
func (*Session) DeleteS3Bucket ¶
DeleteS3Bucket deletes the bucket in S3.
func (*Session) DeleteS3File ¶
DeleteS3File deletes the file in S3.
func (*Session) NewS3Session ¶
NewS3Session initiates a new aws session.
func (*Session) UploadS3FileWithContent ¶
UploadS3FileWithContent creates a new file in S3 with the content specified.
func (*Session) ValidateS3BucketExists ¶
ValidateS3BucketExists verifies the existence of a bucket.
func (*Session) ValidateS3FileExists ¶
ValidateS3FileExists checks the existence of a file in S3.
type Steps ¶
type Steps struct { }
Steps to initialize common steps.
func (Steps) InitializeSteps ¶
func (cs Steps) InitializeSteps(ctx context.Context, scenCtx *godog.ScenarioContext) context.Context
InitializeSteps initializes all the steps to work with S3. It implements StepsInitializer interface.