Documentation
¶
Index ¶
- Variables
- type Config
- type ListItem
- type S3
- func (s *S3) BucketExists(ctx context.Context, bucketName string) (bool, error)
- func (s *S3) CreateBucket(ctx context.Context, bucketName string) error
- func (s *S3) Delete(ctx context.Context, bucketName string, filePaths []string) error
- func (s *S3) DeleteBucket(ctx context.Context, bucketName string) error
- func (s *S3) Download(ctx context.Context, bucketName, filePath string) ([]byte, error)
- func (s *S3) Exists(ctx context.Context, bucketName, filePath string) (bool, error)
- func (s *S3) List(ctx context.Context, bucketName string) ([]ListItem, error)
- func (s *S3) ListBuckets(ctx context.Context) ([]types.Bucket, error)
- func (s *S3) Upload(ctx context.Context, bucketName, filePath string, content []byte) (string, error)
- func (s *S3) UploadStream(ctx context.Context, bucketName, filePath string, reader io.Reader) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyBucketName = errors.New("empty bucket name") ErrEmptyFilePath = errors.New("empty file path") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AccessID string `validate:"required" secret:"true"`
SecretKey string `validate:"required" secret:"true"`
BucketName string `validate:"required"`
Token string `secret:"true" usage:"used only for amazon s3"`
Region string `validate:"required" example:"ru-1"`
Endpoint string `validate:"required"`
}
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 ...
func (*S3) BucketExists ¶
Click to show internal directories.
Click to hide internal directories.