oss

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 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 Client

type Client struct {
	OssClient *oss.Client
	OssBucket *oss.Bucket
	Config    *Config
	UseCname  bool
}

func New

func New(cfg *Config) (*Client, error)

func (*Client) GetUrlByFile

func (client *Client) GetUrlByFile(remoteFile string) string

GetUrlByFile 获取文件完整链接地址

func (*Client) PutObject

func (client *Client) PutObject(remoteFile string, reader io.Reader) error

PutObject 从字节流上传 remoteFile aa/bb/c.txt aa/c.txt c.txt reader bytes.NewReader([]byte("yourObjectValueByteArrary"))

func (*Client) PutObjectFromFile

func (client *Client) PutObjectFromFile(remoteFile, localFile string) error

PutObjectFromFile 从本地文件上传 remoteFile aa/bb/c.txt aa/c.txt c.txt localFile /tmp/c.txt D:\\aa\\bb\\c.txt

func (*Client) PutObjectMulFromFile

func (client *Client) PutObjectMulFromFile(remoteFile, localFile string) error

PutObjectMulFromFile 分片上传

func (*Client) Validate

func (client *Client) Validate() error

Validate 验证配置参数

type Config

type Config struct {
	AccessKeyId     string
	AccessKeySecret string
	Endpoint        string
	Bucket          string
}

Jump to

Keyboard shortcuts

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