oss

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunOSS

type AliyunOSS struct {
	BucketName string
	BucketUrl  string
	// contains filtered or unexported fields
}

func (*AliyunOSS) DeleteFile

func (e *AliyunOSS) DeleteFile(filename string) error

func (*AliyunOSS) DownloadFile

func (e *AliyunOSS) DownloadFile(filename string) (io.ReadCloser, error)

func (*AliyunOSS) GeneratePresignedToken added in v1.0.32

func (e *AliyunOSS) GeneratePresignedToken(uploadDir, filename string, expireSeconds int64) (interface{}, error)

func (*AliyunOSS) GetFileMeta

func (e *AliyunOSS) GetFileMeta(filename string) (map[string][]string, error)

func (*AliyunOSS) IsFileExists added in v1.1.26

func (e *AliyunOSS) IsFileExists(filename string) (bool, error)

func (*AliyunOSS) Name added in v1.0.32

func (e *AliyunOSS) Name() string

func (*AliyunOSS) SignTemporaryExternalUrl added in v1.1.26

func (e *AliyunOSS) SignTemporaryExternalUrl(filename string, expiredInSec int64) (string, error)

func (*AliyunOSS) UpLoadLocalFile

func (e *AliyunOSS) UpLoadLocalFile(yourObjectName string, localFile string) error

UpLoadLocalFile 文件上传

func (*AliyunOSS) UploadFile

func (e *AliyunOSS) UploadFile(file io.Reader, filename string) (string, error)

type ConfigStruct added in v1.0.32

type ConfigStruct struct {
	Expiration string     `json:"expiration"`
	Conditions [][]string `json:"conditions"`
}

type Local

type Local struct {
	Path string
}

func (*Local) DeleteFile

func (l *Local) DeleteFile(filename string) error

func (*Local) DownloadFile

func (l *Local) DownloadFile(filename string) (io.ReadCloser, error)

func (*Local) GeneratePresignedToken added in v1.0.32

func (l *Local) GeneratePresignedToken(directory string, filename string, i int64) (interface{}, error)

func (*Local) GetFileMeta

func (l *Local) GetFileMeta(filename string) (map[string][]string, error)

func (*Local) IsFileExists added in v1.1.26

func (l *Local) IsFileExists(filename string) (bool, error)

func (*Local) Name added in v1.0.32

func (l *Local) Name() string

func (*Local) SignTemporaryExternalUrl added in v1.1.26

func (l *Local) SignTemporaryExternalUrl(filename string, expiredInSec int64) (string, error)

func (*Local) UpLoadLocalFile

func (l *Local) UpLoadLocalFile(objectName string, localFile string) error

func (*Local) UploadFile

func (l *Local) UploadFile(file io.Reader, filename string) (string, error)

type Oss

type Oss interface {
	Name() string
	UpLoadLocalFile(objectName string, localFile string) error
	UploadFile(file io.Reader, filename string) (string, error)
	DownloadFile(filename string) (io.ReadCloser, error)
	GetFileMeta(filename string) (map[string][]string, error)
	DeleteFile(filename string) error
	GeneratePresignedToken(directory string, filename string, i int64) (interface{}, error)
	IsFileExists(filename string) (bool, error)
	SignTemporaryExternalUrl(filename string, expiredInSec int64) (string, error)
}

func NewAliyun

func NewAliyun(endpoint, accessKeyId, accessKeySecret, bucketName string, bucketUrl string) Oss

func NewLocal

func NewLocal(path string) Oss

type PolicyToken added in v1.0.32

type PolicyToken struct {
	AccessKeyId string `json:"accessid"`
	Host        string `json:"host"`
	Expire      int64  `json:"expire"`
	Signature   string `json:"signature"`
	Policy      string `json:"policy"`
	Directory   string `json:"dir"`
	Callback    string `json:"callback"`
}

type S3 added in v1.0.32

type S3 struct {

	//Region        	string
	//AccessKeyId     string
	//AccessKeySecret string
	BucketName string
	BucketUrl  string
	// contains filtered or unexported fields
}

func NewS3 added in v1.0.32

func NewS3(region, accessKeyId, accessKeySecret, bucketName string, bucketUrl string) *S3

func (*S3) DeleteFile added in v1.0.32

func (e *S3) DeleteFile(filename string) error

func (*S3) DownloadFile added in v1.0.32

func (e *S3) DownloadFile(filename string) (io.ReadCloser, error)

func (*S3) GeneratePresignedToken added in v1.0.32

func (e *S3) GeneratePresignedToken(directory string, filename string, exp int64) (interface{}, error)

func (*S3) GetFileMeta added in v1.0.32

func (e *S3) GetFileMeta(filename string) (map[string][]string, error)

func (*S3) IsFileExists added in v1.1.26

func (e *S3) IsFileExists(filename string) (bool, error)

func (*S3) Name added in v1.0.32

func (e *S3) Name() string

func (*S3) SignTemporaryExternalUrl added in v1.1.26

func (e *S3) SignTemporaryExternalUrl(filename string, expiredInSec int64) (string, error)

func (*S3) UpLoadLocalFile added in v1.0.32

func (e *S3) UpLoadLocalFile(objectName string, localFile string) error

func (*S3) UploadFile added in v1.0.32

func (e *S3) UploadFile(file io.Reader, filename string) (string, error)

type TencentCOS

type TencentCOS struct{}

Jump to

Keyboard shortcuts

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