s3

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 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 S3Config

type S3Config struct {
	Region     string `toml:"region" mapstructure:"region" validate:"nonzero"`
	BucketName string `toml:"bucket_name" mapstructure:"bucket_name" validate:"nonzero"`
	AccessKey  string `toml:"access_key" mapstructure:"access_key" validate:"nonzero"`
	SecretKey  string `toml:"secret_key" mapstructure:"secret_key" validate:"nonzero"`
	Endpoint   string `toml:"endpoint" mapstructure:"endpoint" validate:"nonzero"`
	UrlFormat  string `toml:"url_format" mapstructure:"url_format" validate:"nonzero" default:"{endpoint}/{bucket}/{path}"`
}

type S3Uploader

type S3Uploader struct {
	Config S3Config
	// contains filtered or unexported fields
}

func NewS3Uploader

func NewS3Uploader(config S3Config) (*S3Uploader, error)

func (*S3Uploader) PutFile

func (u *S3Uploader) PutFile(localPath, targetPath string) error

func (S3Uploader) Upload

func (u S3Uploader) Upload(t *model.Task) error

Jump to

Keyboard shortcuts

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