s3

package
v0.0.0-...-8411d4f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EC2RoleAwsConfig

func EC2RoleAwsConfig(config *Config) *aws.Config

Types

type Client

type Client struct {
	*s3.S3
	Config *Config
}

Client S3 storage

func New

func New(config *Config) *Client

New initialize S3 storage

func (Client) Delete

func (client Client) Delete(path string) error

Delete delete file

func (Client) Get

func (client Client) Get(path string) (file *os.File, err error)

Get receive file with given path

func (Client) GetEndpoint

func (client Client) GetEndpoint() string

GetEndpoint get endpoint, FileSystem's endpoint is /

func (Client) List

func (client Client) List(path string) ([]*oss.Object, error)

List list all objects under current path

func (Client) Put

func (client Client) Put(urlPath string, reader io.Reader) (*oss.Object, error)

Put store a reader into given path

func (Client) Stat

func (client Client) Stat(path string) (info *os.FileInfo, notFound bool, err error)

Stat receive file stat by path

func (Client) ToRelativePath

func (client Client) ToRelativePath(urlPath string) string

type Config

type Config struct {
	AccessID     string
	AccessKey    string
	Region       string
	Bucket       string
	SessionToken string
	ACL          string
	Endpoint     string
}

Config S3 client config

Jump to

Keyboard shortcuts

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