oss

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliOSS

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

func NewAliOSS

func NewAliOSS(cfg AliOSSConfig) (*AliOSS, error)

roleArn, sessionName aliCloud sts service

func (*AliOSS) Base64Put

func (oss *AliOSS) Base64Put(ctx context.Context, key string, raw []byte, mimeType string) error

func (*AliOSS) Bucket

func (oss *AliOSS) Bucket() string

func (*AliOSS) Delete

func (oss *AliOSS) Delete(key string) error

func (*AliOSS) Domain

func (oss *AliOSS) Domain() string

func (*AliOSS) Put

func (oss *AliOSS) Put(ctx context.Context, key string, data io.Reader, size int64, mimeType string) error

func (*AliOSS) PutToken

func (oss *AliOSS) PutToken(expiredSec int, dir string) (token, accessKey, secretKey string, err error)

func (*AliOSS) RegionId

func (oss *AliOSS) RegionId() string

func (*AliOSS) URL

func (oss *AliOSS) URL(key string) string

type AliOSSConfig

type AliOSSConfig struct {
	AccessKey string
	SecretKey string
	Domain    string
	RegionId  string
	Bucket    string

	StsDomain      string
	StsRoleArn     string
	StsSessionName string
}

type Operation

type Operation interface {
	Put(ctx context.Context, key string, data io.Reader, size int64, mimeType string) error
	Base64Put(ctx context.Context, key string, raw []byte, mimeType string) error
	Delete(key string) error
	Bucket() string
	RegionId() string
	Domain() string
	// gen source URL by key
	URL(key string) string
	// temp Put action Token
	PutToken(expiredSec int, dir string) (token, accessKey, secretKey string, err error)
}

type QiNiuOSS

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

func NewQiNiuOSS

func NewQiNiuOSS(ak, sk, domain, bucket string) *QiNiuOSS

func (*QiNiuOSS) Base64Put

func (oss *QiNiuOSS) Base64Put(ctx context.Context, key string, raw []byte, mimeType string) error

func (*QiNiuOSS) Bucket

func (oss *QiNiuOSS) Bucket() string

func (*QiNiuOSS) Delete

func (oss *QiNiuOSS) Delete(key string) error

func (*QiNiuOSS) Domain

func (oss *QiNiuOSS) Domain() string

func (*QiNiuOSS) Put

func (oss *QiNiuOSS) Put(ctx context.Context, key string, data io.Reader, size int64, mimeType string) error

func (*QiNiuOSS) PutToken

func (oss *QiNiuOSS) PutToken(expiredSec int, dir string) (token, accessKey, secretKey string, err error)

func (*QiNiuOSS) RegionId

func (oss *QiNiuOSS) RegionId() string

func (*QiNiuOSS) URL

func (oss *QiNiuOSS) URL(key string) string

Jump to

Keyboard shortcuts

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