s3

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeHTTPWithSSL    = "https"
	SchemeHTTPWithoutSSL = "http"

	S3HostTemplate = "%s.s3.amazonaws.com"
)

Variables

View Source
var (
	ErrStorageKeyNotMatch = errors.New("storage Key did not match")
	ErrFailedGetFilePath  = errors.New("failed to get file path")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	StorageKey      string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	BucketName      string
	Prefix          string
	NoSSL           bool
}

type S3Storage

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

func New

func New(cfg *Config) *S3Storage
func (s *S3Storage) GetCLink(path string) (cLink string)

func (*S3Storage) GetURL

func (s *S3Storage) GetURL(cLink string, options ...interface{}) string

func (*S3Storage) Remove

func (s *S3Storage) Remove(cLink string) (err error)

func (*S3Storage) Store

func (s *S3Storage) Store(filePath, path string) (cLink string, err error)
func (s *S3Storage) StoreByCLink(filePath, cLink string) (err error)

Jump to

Keyboard shortcuts

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