s3api

package
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

type S3ObjectReference struct {
	Bucket  string
	Key     string
	Hash    string
	Version string
}

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>]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL