joss

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OssTypeJDCloud OssType = "JDCloud"
	OssTypeS3              = "s3"
	OssTypeAzure           = "Azure"
	OssTypeAliYun          = "Aliyun"
)

Variables

View Source
var (
	ENDPOINT = []string{"endpoint"}

	ACCESSKEY = []string{"access_key"}
	SECRETKEY = []string{"secret_key"}
)

Functions

func AccessKey

func AccessKey() string

func Endpoint

func Endpoint() string

func NewS3Client

func NewS3Client() (*s3.S3, *session.Session)

func ParseBucketAndKey

func ParseBucketAndKey(path string) (string, string, error)

func SecretKey

func SecretKey() string

func SetAkSk

func SetAkSk(ak, sk string)

func SetEndpoint

func SetEndpoint(endpoint string)

Types

type Account

type Account struct {
	AccessKey string
	SecretKey string
}

func GetAccount

func GetAccount() (account Account, err error)

type Clientset

type Clientset struct {
	types.ClientInterface
	// contains filtered or unexported fields
}

func New

func New(endpoint, ak, sk string, t OssType) *Clientset

func (*Clientset) GetBytesObject

func (cs *Clientset) GetBytesObject(ctx context.Context, path string) (b []byte, err error)

func (*Clientset) GetObjectToFile

func (cs *Clientset) GetObjectToFile(objectPath string, filePath string) error

func (*Clientset) GetStringObject

func (cs *Clientset) GetStringObject(ctx context.Context, path string) (string, error)

func (*Clientset) PutObjectFromFile

func (cs *Clientset) PutObjectFromFile(objectPath string, filePath string, options ...types.OpOption) error

type OssType

type OssType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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