uploader

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ak       string
	Sk       string
	Endpoint string
	Location string
	Secure   bool
}

type UploadMeta

type UploadMeta struct {
	Bucket      string
	Name        string
	Content     io.Reader
	Buf         []byte // 如果和Content同时存在的话,优先使用Content
	ContentType string
}

type Uploader

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

使用ak/sk进行上传 一般是服务端侧代理上传操作会用到这个

func New

func New(c Config) (*Uploader, error)

func (*Uploader) GetPublicVisitUrl

func (u *Uploader) GetPublicVisitUrl(bucket, objectName, replaceEndpoint string) string

func (*Uploader) Remove

func (u *Uploader) Remove(ctx context.Context, bucket, objectName string) error

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, obj *UploadMeta) error

Jump to

Keyboard shortcuts

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