oss

package
v1.5.18 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrivateExt = ",ts,"

Functions

func BuildSign

func BuildSign(endpoint, bucketName, obj, filename string) (url string, err error)

func GetVersion

func GetVersion() (version string)

func Listfile

func Listfile(maker, endpoint, prefix, bucketName string, num int) (data oss.ListObjectsResult, err error)

func NewOss

func NewOss(endpoint string) (client *oss.Client, err error)

func PutObjectSrc

func PutObjectSrc(endpoint, objectName, bucketName, contxttStr string) (err error)

func ReadToBoundary

func ReadToBoundary(boundary []byte, stream io.ReadCloser, target io.WriteCloser) ([]byte, bool, error)

/ 从流中一直读到文件的末位 / @return []byte 没有写到文件且又属于下一个文件的数据 / @return bool 是否已经读到流的末位了 / @return error 是否发生错误

func SaveFile

func SaveFile(fileName, uploaddir string, fileReader multipart.File) (objectName string, err error)

func SaveFileMd5ByFileReader

func SaveFileMd5ByFileReader(f *multipart.FileHeader) (md5Str, LocalfilePath string, err error)

func SetObjectMeta

func SetObjectMeta(endpoint, bucketName, obj, filename string)

func UploadAvatarFile

func UploadAvatarFile(endpoint, fileName, bucketName, uploaddir string) (resultfile string, err error)

func UploadFile

func UploadFile(endpoint string, fileName, md5, localFilePath string, bucketname string) (file string, err error)

func UploadFileSrc

func UploadFileSrc(endpoint, fileName, bucketName, md5, LocalFilePath string) (resultfile string, err error)

func UploadLocalFile

func UploadLocalFile(endpoint, fileName, bucketName, uploaddir string) (resultfile string, err error)

Types

type FileHeader

type FileHeader struct {
	ContentDisposition string
	Name               string
	FileName           string ///< 文件名
	ContentType        string
	ContentLength      int64
}

/ 解析多个文件上传中,每个具体的文件的信息

func ParseFileHeader

func ParseFileHeader(h []byte) (FileHeader, bool)

/ 解析描述文件信息的头部 / @return FileHeader 文件名等信息的结构体 / @return bool 解析成功还是失败

type OssProgressListener

type OssProgressListener struct {
}

定义进度条监听器。

func (*OssProgressListener) ProgressChanged

func (listener *OssProgressListener) ProgressChanged(event *oss.ProgressEvent)

定义进度变更事件处理函数。

Jump to

Keyboard shortcuts

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