file

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Uploader        *s3client.Client
	PrivateUploader *s3client.Client
	PublicURL       string
	PublicBucket    string
	// contains filtered or unexported fields
}

Store provides file storage via S3.

func NewStore

func NewStore(
	ctx context.Context,
	region,
	publicURL,
	publicBucket,
	privateBucket,
	localstackHost string,
) (*Store, error)

NewStore returns a new store instance for the given AWS region and S3 bucket name.

func (*Store) PutFile

func (store *Store) PutFile(ctx context.Context, reader io.Reader, filename string, isPublished bool) (uploadedFileURL string, err error)

PutFile stores the contents of the given reader to a csv file of given the supplied name.

type Uploader

type Uploader interface {
	Upload(ctx context.Context, input *s3.PutObjectInput, options ...func(*manager.Uploader)) (*manager.UploadOutput, error)
	Config() aws.Config
	BucketName() string
	Checker(ctx context.Context, state *healthcheck.CheckState) error
}

Uploader represents the methods required to upload to s3 with and without encryption

type VaultClient

type VaultClient interface {
	WriteKey(path, key, value string) error
}

VaultClient is an interface to represent methods called to action upon vault

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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