s3

package
v0.0.0-...-0728cc5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Client

type S3Client struct {
	S3     *s3.S3
	Config S3Config
}

S3Client contains configuration and a client for an S3-compatible storage service

func NewClient

func NewClient(conf S3Config) (client *S3Client)

NewSession returns a new S3 session, given an S3Config

func (*S3Client) ListBucket

func (s *S3Client) ListBucket() (err error)

func (*S3Client) UploadFile

func (s *S3Client) UploadFile(filename string, filekey string) error

UploadFile uploads the file filename to the supplied bucket with the key filekey using the provided S3 session.

type S3Config

type S3Config struct {
	AccessKeyID     string
	SecretAccessKey string
	EndpointURL     string `mapstructure:"Endpoint"`
	Region          string
	Bucket          string
	Enabled         bool
}

S3Config contains configuration for an S3-compatible storage service

Jump to

Keyboard shortcuts

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