Documentation ¶
Index ¶
- Constants
- type SimpleStorageService
- func (s *SimpleStorageService) Delete(ctx context.Context, objectID string) error
- func (s *SimpleStorageService) Exists(ctx context.Context, objectID string) (bool, error)
- func (s *SimpleStorageService) GetRequest(ctx context.Context, objectID string, duration time.Duration, ...) (*images.Link, error)
- func (s *SimpleStorageService) LastModified(ctx context.Context, objectID string) (time.Time, error)
- func (s *SimpleStorageService) PutRequest(ctx context.Context, objectID string, duration time.Duration) (*images.Link, error)
- func (s *SimpleStorageService) UploadArtifact(ctx context.Context, objectID string, size int64, artifact io.Reader, ...) error
Constants ¶
View Source
const ( ExpireMaxLimit = 7 * 24 * time.Hour ExpireMinLimit = 1 * time.Minute ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleStorageService ¶
type SimpleStorageService struct {
// contains filtered or unexported fields
}
SimpleStorageService - AWS S3 client. Data layer for file storage. Implements model.FileStorage interface
func NewSimpleStorageServiceDefaults ¶
func NewSimpleStorageServiceDefaults(bucket, region string) (*SimpleStorageService, error)
NewSimpleStorageServiceDefaults create new S3 client model. Use default authentication provides which looks at env variables, Aws profile file and ec2 iam role
func NewSimpleStorageServiceStatic ¶
func NewSimpleStorageServiceStatic(bucket, key, secret, region, token, uri string, tag_artifact bool) (*SimpleStorageService, error)
NewSimpleStorageServiceStatic create new S3 client model. AWS authentication keys are automatically reloaded from env variables.
func (*SimpleStorageService) Delete ¶
func (s *SimpleStorageService) Delete(ctx context.Context, objectID string) error
Delete removes delected file from storage. Noop if ID does not exist.
func (*SimpleStorageService) GetRequest ¶
func (s *SimpleStorageService) GetRequest(ctx context.Context, objectID string, duration time.Duration, responseContentType string) (*images.Link, error)
GetRequest duration is limited to 7 days (AWS limitation)
func (*SimpleStorageService) LastModified ¶
func (s *SimpleStorageService) LastModified(ctx context.Context, objectID string) (time.Time, error)
LastModified returns last file modification time. If object not found return ErrFileStorageFileNotFound
Click to show internal directories.
Click to hide internal directories.