upload

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Reader

type S3Reader struct {
	// contains filtered or unexported fields
}

S3Reader reads objects from S3-compatible storage.

func NewS3Reader

func NewS3Reader(
	log logrus.FieldLogger,
	cfg *config.S3UploadConfig,
) *S3Reader

NewS3Reader creates a new S3Reader from the given configuration.

func (*S3Reader) GetObject

func (r *S3Reader) GetObject(
	ctx context.Context, key string,
) ([]byte, error)

GetObject returns the contents of the given key. If the key does not exist, it returns (nil, nil).

func (*S3Reader) ListPrefixes

func (r *S3Reader) ListPrefixes(
	ctx context.Context, prefix string,
) ([]string, error)

ListPrefixes lists immediate "subdirectory" prefixes under the given prefix. The prefix should end with "/" (e.g. "results/runs/").

func (*S3Reader) PutObject

func (r *S3Reader) PutObject(
	ctx context.Context, key string, data []byte, contentType string,
) error

PutObject writes data to the given key with the specified content type.

type Uploader

type Uploader interface {
	// Preflight verifies that the remote storage is reachable and writable.
	// Writes a small test object to the bucket to fail fast on misconfiguration.
	Preflight(ctx context.Context) error

	// Upload uploads all files in localDir. The directory basename is
	// used as a sub-prefix under the configured remote prefix.
	Upload(ctx context.Context, localDir string) error

	// UploadSuiteDir uploads a suite directory to remote storage under
	// prefix + "/suites/" + dirname.
	UploadSuiteDir(ctx context.Context, localSuiteDir string) error
}

Uploader uploads a local result directory to remote storage.

func NewS3Uploader

func NewS3Uploader(
	log logrus.FieldLogger,
	cfg *config.S3UploadConfig,
) (Uploader, error)

NewS3Uploader creates a new S3 uploader from the given configuration.

Jump to

Keyboard shortcuts

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