Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidChecksumCalculationMode = errors.New("invalid checksum calculation mode")
Functions ¶
This section is empty.
Types ¶
type ChecksumMode ¶ added in v1.1.0
type ChecksumMode string
const ( ChecksumSupported ChecksumMode = "supported" ChecksumRequired ChecksumMode = "required" )
func (ChecksumMode) IsValid ¶ added in v1.1.0
func (cm ChecksumMode) IsValid() bool
func (*ChecksumMode) Set ¶ added in v1.1.0
func (cm *ChecksumMode) Set(value string) error
func (*ChecksumMode) String ¶ added in v1.1.0
func (cm *ChecksumMode) String() string
type Client ¶
type Client struct {
S3 *S3
Cloudfront *Cloudfront
}
type Cloudfront ¶
type Cloudfront struct {
Distribution string
// contains filtered or unexported fields
}
func (*Cloudfront) Invalidate ¶
func (c *Cloudfront) Invalidate(ctx context.Context, opt CloudfrontInvalidateOptions) error
Invalidate invalidates the specified path in the CloudFront distribution.
type CloudfrontAPIClient ¶
type CloudfrontAPIClient interface {
CreateInvalidation(ctx context.Context, params *cloudfront.CreateInvalidationInput, optFns ...func(*cloudfront.Options)) (*cloudfront.CreateInvalidationOutput, error)
}
type CloudfrontInvalidateOptions ¶
type CloudfrontInvalidateOptions struct {
Path string
}
type S3 ¶
func (*S3) Delete ¶
func (u *S3) Delete(ctx context.Context, opt S3DeleteOptions) error
Delete removes the specified object from the S3 bucket.
func (*S3) Redirect ¶
func (u *S3) Redirect(ctx context.Context, opt S3RedirectOptions) error
Redirect adds a redirect from the specified path to the specified location in the S3 bucket.
func (*S3) Upload ¶
func (u *S3) Upload(ctx context.Context, opt S3UploadOptions) error
Upload uploads a file to an S3 bucket. It first checks if the file already exists in the bucket and compares the local file's content and metadata with the remote file. If the file has changed, it updates the remote file's metadata. If the file does not exist or has changed, it uploads the local file to the remote bucket.
type S3APIClient ¶
type S3APIClient interface {
HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
CopyObject(ctx context.Context, params *s3.CopyObjectInput, optFns ...func(*s3.Options)) (*s3.CopyObjectOutput, error)
GetObjectAcl(ctx context.Context, params *s3.GetObjectAclInput, optFns ...func(*s3.Options)) (*s3.GetObjectAclOutput, error)
DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error)
ListObjects(ctx context.Context, params *s3.ListObjectsInput, optFns ...func(*s3.Options)) (*s3.ListObjectsOutput, error)
}
type S3DeleteOptions ¶
type S3DeleteOptions struct {
RemoteObjectKey string
}
type S3ListOptions ¶
type S3ListOptions struct {
Path string
}
type S3RedirectOptions ¶
Click to show internal directories.
Click to hide internal directories.