myhwoss

package
v0.0.0-...-8c26535 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	ObsClient  *obs.ObsClient
	BucketName string
}

Bucket 存储桶

func CreateOSSBucket

func CreateOSSBucket(endPoint, ak, sk, bucketName string) (*Bucket, error)

CreateOSSBucket 获取OSS对象存储桶

func (*Bucket) DeleteObject

func (b *Bucket) DeleteObject(filenames []string) ([]string, error)

DeleteObject 删除文件

func (*Bucket) GetObjectACL

func (b *Bucket) GetObjectACL(objectKey string) ([]obs.Grant, error)

GetObjectACL 获取文件的访问权限

func (*Bucket) GetObjectMeta

func (b *Bucket) GetObjectMeta(objectName string) (map[string][]string, error)

GetObjectMeta 获取文件元信息

func (*Bucket) GetObjectToFile

func (b *Bucket) GetObjectToFile(objectKey string, filePath string) error

GetObjectToFile 下载到本地文件

func (*Bucket) IsObjectExist

func (b *Bucket) IsObjectExist(filename string) (bool, error)

IsObjectExist 判断文件是否存在

func (*Bucket) PutObjectFromBytes

func (b *Bucket) PutObjectFromBytes(from []byte, to string) error

PutObjectFromReader 上传文件流

func (*Bucket) PutObjectFromFile

func (b *Bucket) PutObjectFromFile(from string, to string) error

PutObjectFromFile 上传文件流

func (*Bucket) PutObjectFromFileName

func (b *Bucket) PutObjectFromFileName(from string, to string) error

PutObjectFromFileName 上传本地文件

func (*Bucket) SetObjectACL

func (b *Bucket) SetObjectACL(objectKey string, _type []obs.Grant) error

SetObjectACL 设置文件的访问权限

type BucketInfo

type BucketInfo struct {
	Name                   string    `xml:"Name"`                    // 桶名
	Location               string    `xml:"Location"`                // Bucket所在的地域
	CreationDate           time.Time `xml:"CreationDate"`            // Bucket的创建时间,格式为UTC时间
	ExtranetEndpoint       string    `xml:"ExtranetEndpoint"`        // Bucket的外网域名
	IntranetEndpoint       string    `xml:"IntranetEndpoint"`        // 同地域ECS访问Bucket的内网域名
	ACL                    string    `xml:"AccessControlList>Grant"` // Bucket读写权限(ACL)信息的容器
	RedundancyType         string    `xml:"DataRedundancyType"`      // Bucket的数据容灾类型
	StorageClass           string    `xml:"StorageClass"`            // Bucket的存储类型
	Versioning             string    `xml:"Versioning"`              // Bucket的版本控制状态。有效值:Enabled、Suspended
	TransferAcceleration   string    `xml:"TransferAcceleration"`    // 显示Bucket的传输加速状态。有效值:Enabled、Disabled
	CrossRegionReplication string    `xml:"CrossRegionReplication"`  // 显示Bucket的跨区域复制状态。有效值:Enabled、Disabled
}

BucketInfo 存储桶的信息

type ObsProgressListener

type ObsProgressListener struct {
}

定义进度条监听器。

func (*ObsProgressListener) ProgressChanged

func (listener *ObsProgressListener) ProgressChanged(event *obs.ProgressEvent)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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