Documentation
¶
Index ¶
Constants ¶
View Source
const ( APIEndpointEnvVar = "S3_API_ENDPOINT" RegionEnvVar = "S3_REGION" AccessKeyIDEnvVar = "S3_ACCESS_KEY_ID" SecretAccessKeyEnvVar = "S3_SECRET_KEY" )
Variables ¶
This section is empty.
Functions ¶
func DownloadObject ¶
func DownloadObject(ctx context.Context, client S3ClientAPI, ref *S3ObjectReference, outputPath string) error
func VerifyObjectExists ¶
func VerifyObjectExists(ctx context.Context, client S3ClientAPI, ref *S3ObjectReference) error
Types ¶
type S3ClientAPI ¶
type S3ClientAPI interface {
HeadObject(context.Context, *s3.HeadObjectInput, ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
GetObject(context.Context, *s3.GetObjectInput, ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}
S3ClientAPI is a wrapper over s3.Client to allow mocking intests
func SetUpClient ¶
func SetUpClient(ctx context.Context) (S3ClientAPI, error)
type S3ObjectReference ¶
func ParseS3ObjectReference ¶
func ParseS3ObjectReference(ref string, hash string) (*S3ObjectReference, error)
ParseS3ObjectReference parses a Kit-spec 's3://' reference and hash into an S3ObjectReference. For filling endpoint and region, environment variables are read. The format for an s3:// reference is
s3://<bucket-name>/<object-key>[?versionId=<version-ID>]
Click to show internal directories.
Click to hide internal directories.