Documentation ¶
Index ¶
- Variables
- func InitializeContext(ctx context.Context) context.Context
- type ClientFunctions
- type ClientService
- func (c ClientService) CreateBucket(ctx context.Context, s3Client *s3.Client, input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
- func (c ClientService) DeleteBucket(ctx context.Context, s3Client *s3.Client, input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
- func (c ClientService) DeleteObject(ctx context.Context, s3Client *s3.Client, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
- func (c ClientService) Download(ctx context.Context, s3Client *s3.Client, downloader *s3manager.Downloader, ...) (int64, error)
- func (c ClientService) GetBucketLocation(ctx context.Context, s3Client *s3.Client, input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
- func (c ClientService) HeadObject(ctx context.Context, s3Client *s3.Client, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (c ClientService) New(cfgs aws.Config) *s3.Client
- func (c ClientService) NewDownloader(s3Client *s3.Client) *s3manager.Downloader
- func (c ClientService) NewUploader(s3Client *s3.Client) *s3manager.Uploader
- func (c ClientService) Upload(ctx context.Context, s3Client *s3.Client, uploader *s3manager.Uploader, ...) (*s3manager.UploadOutput, error)
- type ClientServiceFuncMock
- func (c ClientServiceFuncMock) CreateBucket(ctx context.Context, s3Client *s3.Client, input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
- func (c ClientServiceFuncMock) DeleteBucket(ctx context.Context, s3Client *s3.Client, input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
- func (c ClientServiceFuncMock) DeleteObject(ctx context.Context, s3Client *s3.Client, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
- func (c ClientServiceFuncMock) Download(ctx context.Context, s3Client *s3.Client, downloader *s3manager.Downloader, ...) (int64, error)
- func (c ClientServiceFuncMock) GetBucketLocation(ctx context.Context, s3Client *s3.Client, input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
- func (c ClientServiceFuncMock) HeadObject(ctx context.Context, s3Client *s3.Client, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (c ClientServiceFuncMock) New(cfgs aws.Config) *s3.Client
- func (c ClientServiceFuncMock) NewDownloader(s3Client *s3.Client) *s3manager.Downloader
- func (c ClientServiceFuncMock) NewUploader(s3Client *s3.Client) *s3manager.Uploader
- func (c ClientServiceFuncMock) Upload(ctx context.Context, s3Client *s3.Client, uploader *s3manager.Uploader, ...) (*s3manager.UploadOutput, error)
- 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 ¶
Functions ¶
Types ¶
type ClientFunctions ¶
type ClientFunctions interface { New(cfgs aws.Config) *s3.Client NewUploader(s3Client *s3.Client) *s3manager.Uploader Upload( ctx context.Context, s3Client *s3.Client, uploader *s3manager.Uploader, bucket, key, message string, ) (*s3manager.UploadOutput, error) CreateBucket(ctx context.Context, s3Client *s3.Client, input *s3.CreateBucketInput, ) (*s3.CreateBucketOutput, error) DeleteBucket( ctx context.Context, s3Client *s3.Client, input *s3.DeleteBucketInput, ) (*s3.DeleteBucketOutput, error) GetBucketLocation( ctx context.Context, s3Client *s3.Client, input *s3.GetBucketLocationInput, ) (*s3.GetBucketLocationOutput, error) HeadObject( ctx context.Context, s3Client *s3.Client, input *s3.HeadObjectInput, ) (*s3.HeadObjectOutput, error) NewDownloader(s3Client *s3.Client) *s3manager.Downloader Download( ctx context.Context, s3Client *s3.Client, downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput, ) (int64, error) DeleteObject( ctx context.Context, s3Client *s3.Client, input *s3.DeleteObjectInput, ) (*s3.DeleteObjectOutput, error) }
type ClientService ¶
type ClientService struct{}
func NewS3ClientService ¶
func NewS3ClientService() *ClientService
func (ClientService) CreateBucket ¶
func (c ClientService) CreateBucket( ctx context.Context, s3Client *s3.Client, input *s3.CreateBucketInput, ) (*s3.CreateBucketOutput, error)
func (ClientService) DeleteBucket ¶
func (c ClientService) DeleteBucket( ctx context.Context, s3Client *s3.Client, input *s3.DeleteBucketInput, ) (*s3.DeleteBucketOutput, error)
func (ClientService) DeleteObject ¶
func (c ClientService) DeleteObject( ctx context.Context, s3Client *s3.Client, input *s3.DeleteObjectInput, ) (*s3.DeleteObjectOutput, error)
func (ClientService) Download ¶
func (c ClientService) Download( ctx context.Context, s3Client *s3.Client, downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput, ) (int64, error)
func (ClientService) GetBucketLocation ¶
func (c ClientService) GetBucketLocation( ctx context.Context, s3Client *s3.Client, input *s3.GetBucketLocationInput, ) (*s3.GetBucketLocationOutput, error)
func (ClientService) HeadObject ¶
func (c ClientService) HeadObject( ctx context.Context, s3Client *s3.Client, input *s3.HeadObjectInput, ) (*s3.HeadObjectOutput, error)
func (ClientService) NewDownloader ¶
func (c ClientService) NewDownloader(s3Client *s3.Client) *s3manager.Downloader
func (ClientService) NewUploader ¶
func (c ClientService) NewUploader(s3Client *s3.Client) *s3manager.Uploader
type ClientServiceFuncMock ¶
type ClientServiceFuncMock struct{}
func (ClientServiceFuncMock) CreateBucket ¶
func (c ClientServiceFuncMock) CreateBucket(ctx context.Context, s3Client *s3.Client, input *s3.CreateBucketInput, ) (*s3.CreateBucketOutput, error)
func (ClientServiceFuncMock) DeleteBucket ¶
func (c ClientServiceFuncMock) DeleteBucket( ctx context.Context, s3Client *s3.Client, input *s3.DeleteBucketInput, ) (*s3.DeleteBucketOutput, error)
func (ClientServiceFuncMock) DeleteObject ¶
func (c ClientServiceFuncMock) DeleteObject( ctx context.Context, s3Client *s3.Client, input *s3.DeleteObjectInput, ) (*s3.DeleteObjectOutput, error)
func (ClientServiceFuncMock) Download ¶
func (c ClientServiceFuncMock) Download( ctx context.Context, s3Client *s3.Client, downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput, ) (int64, error)
func (ClientServiceFuncMock) GetBucketLocation ¶
func (c ClientServiceFuncMock) GetBucketLocation( ctx context.Context, s3Client *s3.Client, input *s3.GetBucketLocationInput, ) (*s3.GetBucketLocationOutput, error)
func (ClientServiceFuncMock) HeadObject ¶
func (c ClientServiceFuncMock) HeadObject( ctx context.Context, s3Client *s3.Client, input *s3.HeadObjectInput, ) (*s3.HeadObjectOutput, error)
func (ClientServiceFuncMock) NewDownloader ¶
func (c ClientServiceFuncMock) NewDownloader(s3Client *s3.Client) *s3manager.Downloader
func (ClientServiceFuncMock) NewUploader ¶
func (c ClientServiceFuncMock) NewUploader(s3Client *s3.Client) *s3manager.Uploader
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 ¶
Logger logs 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 (Logger) LogOperation ¶
Log a S3 operation
type Session ¶
type Session struct { Client *s3.Client CreatedBuckets []*CreatedBucket CreatedDocuments []*CreatedDocument S3ServiceClient ClientFunctions }
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.