Documentation ¶
Index ¶
- Constants
- type BucketSelector
- type S3StorageService
- func (s *S3StorageService) Delete(ctx context.Context, req *storagepb.StorageDeleteRequest) (*storagepb.StorageDeleteResponse, error)
- func (s *S3StorageService) Exists(ctx context.Context, req *storagepb.StorageExistsRequest) (*storagepb.StorageExistsResponse, error)
- func (s *S3StorageService) ListBlobs(ctx context.Context, req *storagepb.StorageListBlobsRequest) (*storagepb.StorageListBlobsResponse, error)
- func (s *S3StorageService) PreSignUrl(ctx context.Context, req *storagepb.StoragePreSignUrlRequest) (*storagepb.StoragePreSignUrlResponse, error)
- func (s *S3StorageService) Read(ctx context.Context, req *storagepb.StorageReadRequest) (*storagepb.StorageReadResponse, error)
- func (s *S3StorageService) Write(ctx context.Context, req *storagepb.StorageWriteRequest) (*storagepb.StorageWriteResponse, error)
- type S3StorageServiceOption
Constants ¶
View Source
const ( // ErrCodeNoSuchTagSet - AWS API neglects to include a constant for this error code. ErrCodeNoSuchTagSet = "NoSuchTagSet" ErrCodeAccessDenied = "AccessDenied" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketSelector ¶
type S3StorageService ¶
type S3StorageService struct {
// contains filtered or unexported fields
}
S3StorageService - an AWS S3 implementation of the Nitric Storage Service
func New ¶
func New(resolver resource.AwsResourceResolver) (*S3StorageService, error)
New creates a new default S3 storage plugin
func NewWithClient ¶
func NewWithClient(provider resource.AwsResourceResolver, client s3iface.S3API, preSignClient s3iface.PreSignAPI, opts ...S3StorageServiceOption) (*S3StorageService, error)
NewWithClient creates a new S3 Storage plugin and injects the given client
func (*S3StorageService) Delete ¶
func (s *S3StorageService) Delete(ctx context.Context, req *storagepb.StorageDeleteRequest) (*storagepb.StorageDeleteResponse, error)
Delete a file from a bucket
func (*S3StorageService) Exists ¶
func (s *S3StorageService) Exists(ctx context.Context, req *storagepb.StorageExistsRequest) (*storagepb.StorageExistsResponse, error)
func (*S3StorageService) ListBlobs ¶
func (s *S3StorageService) ListBlobs(ctx context.Context, req *storagepb.StorageListBlobsRequest) (*storagepb.StorageListBlobsResponse, error)
ListFiles lists all files in a bucket
func (*S3StorageService) PreSignUrl ¶
func (s *S3StorageService) PreSignUrl(ctx context.Context, req *storagepb.StoragePreSignUrlRequest) (*storagepb.StoragePreSignUrlResponse, error)
PreSignUrl generates a signed URL which can be used to perform direct operations on a file useful for large file uploads/downloads so they can bypass application code and work directly with S3
func (*S3StorageService) Read ¶
func (s *S3StorageService) Read(ctx context.Context, req *storagepb.StorageReadRequest) (*storagepb.StorageReadResponse, error)
Read and return the contents of a file in a bucket
func (*S3StorageService) Write ¶
func (s *S3StorageService) Write(ctx context.Context, req *storagepb.StorageWriteRequest) (*storagepb.StorageWriteResponse, error)
Write contents to a file in a bucket
type S3StorageServiceOption ¶
type S3StorageServiceOption interface {
Apply(*S3StorageService)
}
func WithSelector ¶
func WithSelector(selector BucketSelector) S3StorageServiceOption
Click to show internal directories.
Click to hide internal directories.