oss

package
v2.0.77 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ext

func Ext(filename string) string

Ext 获取存储子目录

Types

type OSS

type OSS interface {
	MakeBucket(ctx context.Context, bucketName string) error                                                                 // 创建桶
	PutObject(ctx context.Context, bucketName string, objectName string, reader io.Reader, objectSize int64) (string, error) // 上传文件
	PutObjectFromFile(ctx context.Context, bucketName, objectName, localFile string) (string, error)                         // 本地文件上传
}

OSS oss接口

type OSSClient

type OSSClient struct {
	Store OSS
}

OSSClient oss客户端

func NewOSS

func NewOSS() (*OSSClient, error)

func (*OSSClient) PutObject

func (o *OSSClient) PutObject(ctx context.Context, objectName string, reader io.Reader, objectSize int64) (string, error)

PutObject 上传对象

func (*OSSClient) PutObjectFromFile

func (o *OSSClient) PutObjectFromFile(ctx context.Context, objectName, localFile string) (string, error)

PutObjectFromFile 上传本地文件

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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