Documentation
¶
Index ¶
- Variables
- func InitializeContext(ctx context.Context) context.Context
- type ClientFunctions
- type ClientService
- func (c ClientService) CreateBucket(s3Client *s3.S3, input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
- func (c ClientService) DeleteBucket(s3Client *s3.S3, input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
- func (c ClientService) DeleteObject(s3Client *s3.S3, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
- func (c ClientService) Download(downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput) (int64, error)
- func (c ClientService) GetBucketLocation(s3Client *s3.S3, input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
- func (c ClientService) HeadObject(s3Client *s3.S3, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (c ClientService) New(client *aws_s.Session) *s3.S3
- func (c ClientService) NewDownloader(client *aws_s.Session) *s3manager.Downloader
- func (c ClientService) NewSession(cfgs *aws.Config) (*aws_s.Session, error)
- func (c ClientService) NewUploader(client *aws_s.Session) *s3manager.Uploader
- func (c ClientService) Upload(uploader *s3manager.Uploader, bucket, key, message string) (*s3manager.UploadOutput, error)
- type ClientServiceFuncMock
- func (c ClientServiceFuncMock) CreateBucket(s3Client *s3.S3, input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
- func (c ClientServiceFuncMock) DeleteBucket(s3Client *s3.S3, input *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
- func (c ClientServiceFuncMock) DeleteObject(s3Client *s3.S3, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
- func (c ClientServiceFuncMock) Download(downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput) (int64, error)
- func (c ClientServiceFuncMock) GetBucketLocation(s3Client *s3.S3, input *s3.GetBucketLocationInput) (*s3.GetBucketLocationOutput, error)
- func (c ClientServiceFuncMock) HeadObject(s3Client *s3.S3, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (c ClientServiceFuncMock) New(client *aws_s.Session) *s3.S3
- func (c ClientServiceFuncMock) NewDownloader(client *aws_s.Session) *s3manager.Downloader
- func (c ClientServiceFuncMock) NewSession(cfgs *aws.Config) (*aws_s.Session, error)
- func (c ClientServiceFuncMock) NewUploader(client *aws_s.Session) *s3manager.Uploader
- func (c ClientServiceFuncMock) Upload(uploader *s3manager.Uploader, bucket, key, message string) (*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 ¶ added in v0.16.0
type ClientFunctions interface {
NewSession(cfgs *aws.Config) (*aws_s.Session, error)
NewUploader(client *aws_s.Session) *s3manager.Uploader
Upload(
uploader *s3manager.Uploader,
bucket, key, message string,
) (*s3manager.UploadOutput, error)
New(client *aws_s.Session) *s3.S3
CreateBucket(
s3Client *s3.S3,
input *s3.CreateBucketInput,
) (*s3.CreateBucketOutput, error)
DeleteBucket(
s3Client *s3.S3,
input *s3.DeleteBucketInput,
) (*s3.DeleteBucketOutput, error)
GetBucketLocation(
s3Client *s3.S3,
input *s3.GetBucketLocationInput,
) (*s3.GetBucketLocationOutput, error)
HeadObject(
s3Client *s3.S3,
input *s3.HeadObjectInput,
) (*s3.HeadObjectOutput, error)
NewDownloader(client *aws_s.Session) *s3manager.Downloader
Download(
downloader *s3manager.Downloader,
w io.WriterAt,
input *s3.GetObjectInput,
) (int64, error)
DeleteObject(s3Client *s3.S3,
input *s3.DeleteObjectInput,
) (*s3.DeleteObjectOutput, error)
}
type ClientService ¶ added in v0.16.0
type ClientService struct{}
func NewS3ClientService ¶ added in v0.16.0
func NewS3ClientService() *ClientService
func (ClientService) CreateBucket ¶ added in v0.16.0
func (c ClientService) CreateBucket( s3Client *s3.S3, input *s3.CreateBucketInput, ) (*s3.CreateBucketOutput, error)
func (ClientService) DeleteBucket ¶ added in v0.16.0
func (c ClientService) DeleteBucket( s3Client *s3.S3, input *s3.DeleteBucketInput, ) (*s3.DeleteBucketOutput, error)
func (ClientService) DeleteObject ¶ added in v0.16.0
func (c ClientService) DeleteObject(s3Client *s3.S3, input *s3.DeleteObjectInput, ) (*s3.DeleteObjectOutput, error)
func (ClientService) Download ¶ added in v0.16.0
func (c ClientService) Download( downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput, ) (int64, error)
func (ClientService) GetBucketLocation ¶ added in v0.16.0
func (c ClientService) GetBucketLocation( s3Client *s3.S3, input *s3.GetBucketLocationInput, ) (*s3.GetBucketLocationOutput, error)
func (ClientService) HeadObject ¶ added in v0.16.0
func (c ClientService) HeadObject( s3Client *s3.S3, input *s3.HeadObjectInput, ) (*s3.HeadObjectOutput, error)
func (ClientService) New ¶ added in v0.16.0
func (c ClientService) New(client *aws_s.Session) *s3.S3
func (ClientService) NewDownloader ¶ added in v0.16.0
func (c ClientService) NewDownloader(client *aws_s.Session) *s3manager.Downloader
func (ClientService) NewSession ¶ added in v0.16.0
func (ClientService) NewUploader ¶ added in v0.16.0
func (c ClientService) NewUploader(client *aws_s.Session) *s3manager.Uploader
func (ClientService) Upload ¶ added in v0.16.0
func (c ClientService) Upload( uploader *s3manager.Uploader, bucket, key, message string, ) (*s3manager.UploadOutput, error)
type ClientServiceFuncMock ¶ added in v0.16.0
type ClientServiceFuncMock struct{}
func (ClientServiceFuncMock) CreateBucket ¶ added in v0.16.0
func (c ClientServiceFuncMock) CreateBucket( s3Client *s3.S3, input *s3.CreateBucketInput, ) (*s3.CreateBucketOutput, error)
func (ClientServiceFuncMock) DeleteBucket ¶ added in v0.16.0
func (c ClientServiceFuncMock) DeleteBucket( s3Client *s3.S3, input *s3.DeleteBucketInput, ) (*s3.DeleteBucketOutput, error)
func (ClientServiceFuncMock) DeleteObject ¶ added in v0.16.0
func (c ClientServiceFuncMock) DeleteObject(s3Client *s3.S3, input *s3.DeleteObjectInput, ) (*s3.DeleteObjectOutput, error)
func (ClientServiceFuncMock) Download ¶ added in v0.16.0
func (c ClientServiceFuncMock) Download( downloader *s3manager.Downloader, w io.WriterAt, input *s3.GetObjectInput, ) (int64, error)
func (ClientServiceFuncMock) GetBucketLocation ¶ added in v0.16.0
func (c ClientServiceFuncMock) GetBucketLocation( s3Client *s3.S3, input *s3.GetBucketLocationInput, ) (*s3.GetBucketLocationOutput, error)
func (ClientServiceFuncMock) HeadObject ¶ added in v0.16.0
func (c ClientServiceFuncMock) HeadObject( s3Client *s3.S3, input *s3.HeadObjectInput, ) (*s3.HeadObjectOutput, error)
func (ClientServiceFuncMock) New ¶ added in v0.16.0
func (c ClientServiceFuncMock) New(client *aws_s.Session) *s3.S3
func (ClientServiceFuncMock) NewDownloader ¶ added in v0.16.0
func (c ClientServiceFuncMock) NewDownloader(client *aws_s.Session) *s3manager.Downloader
func (ClientServiceFuncMock) NewSession ¶ added in v0.16.0
func (ClientServiceFuncMock) NewUploader ¶ added in v0.16.0
func (c ClientServiceFuncMock) NewUploader(client *aws_s.Session) *s3manager.Uploader
func (ClientServiceFuncMock) Upload ¶ added in v0.16.0
func (c ClientServiceFuncMock) Upload( uploader *s3manager.Uploader, bucket, key, message string, ) (*s3manager.UploadOutput, error)
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 *aws_s.Session
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.