object

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeMimeType

func ChangeMimeType(info *ChangeMimeApiInfo) (*batch.OperationResult, *data.CodeError)

func Copy

func Delete

func Exist

func Exist(info ExistApiInfo) (exists bool, err *data.CodeError)

func Move

func PreFop

func PreFop(info PreFopApiInfo) (string, *data.CodeError)

func PreFopStatus

func PreFopStatus(persistentId string) (storage.PrefopRet, *data.CodeError)

func SaveAs

func SaveAs(info SaveAsApiInfo) (string, *data.CodeError)

Types

type AsyncFetchApiInfo

type AsyncFetchApiInfo struct {
	Url              string `json:"url"`
	Host             string `json:"host,omitempty"`
	Bucket           string `json:"bucket"`
	Key              string `json:"key,omitempty"`
	Md5              string `json:"md5,omitempty"`
	Etag             string `json:"etag,omitempty"`
	CallbackURL      string `json:"callbackurl,omitempty"`
	CallbackBody     string `json:"callbackbody,omitempty"`
	CallbackBodyType string `json:"callbackbodytype,omitempty"`
	FileType         int    `json:"file_type,omitempty"`
	IgnoreSameKey    bool   `json:"ignore_same_key"` // false: 如果空间中已经存在同名文件则放弃本次抓取(仅对比 Key,不校验文件内容), true: 有同名会抓取
}

type AsyncFetchApiResult

type AsyncFetchApiResult struct {
	Id   string `json:"id"`
	Wait int    `json:"wait"`
}

func AsyncFetch

func AsyncFetch(info AsyncFetchApiInfo) (result AsyncFetchApiResult, err *data.CodeError)

func CheckAsyncFetchStatus

func CheckAsyncFetchStatus(toBucket, id string) (ret AsyncFetchApiResult, err *data.CodeError)

func (AsyncFetchApiResult) String

func (result AsyncFetchApiResult) String() string

type ChangeMimeApiInfo

type ChangeMimeApiInfo struct {
	Bucket string
	Key    string
	Mime   string
}

func (*ChangeMimeApiInfo) ToOperation

func (c *ChangeMimeApiInfo) ToOperation() (string, *data.CodeError)

func (*ChangeMimeApiInfo) WorkId

func (c *ChangeMimeApiInfo) WorkId() string

type ChangeStatusApiInfo

type ChangeStatusApiInfo struct {
	Bucket string
	Key    string
	Status int
}

ChangeStatusApiInfo 修改 status

func (*ChangeStatusApiInfo) ToOperation

func (c *ChangeStatusApiInfo) ToOperation() (string, *data.CodeError)

func (*ChangeStatusApiInfo) WorkId

func (c *ChangeStatusApiInfo) WorkId() string

type ChangeTypeApiInfo

type ChangeTypeApiInfo struct {
	Bucket string
	Key    string
	Type   int
}

func (*ChangeTypeApiInfo) ToOperation

func (c *ChangeTypeApiInfo) ToOperation() (string, *data.CodeError)

func (*ChangeTypeApiInfo) WorkId

func (c *ChangeTypeApiInfo) WorkId() string

type CopyApiInfo

type CopyApiInfo struct {
	SourceBucket string
	SourceKey    string
	DestBucket   string
	DestKey      string
	Force        bool
}

func (*CopyApiInfo) ToOperation

func (m *CopyApiInfo) ToOperation() (string, *data.CodeError)

func (*CopyApiInfo) WorkId

func (m *CopyApiInfo) WorkId() string

type DeleteApiInfo

type DeleteApiInfo struct {
	Bucket          string
	Key             string
	DeleteAfterDays int
	Condition       batch.OperationCondition
}

func (*DeleteApiInfo) ToOperation

func (d *DeleteApiInfo) ToOperation() (string, *data.CodeError)

func (*DeleteApiInfo) WorkId

func (d *DeleteApiInfo) WorkId() string

type ExistApiInfo

type ExistApiInfo struct {
	Bucket string
	Key    string
}

type FetchApiInfo

type FetchApiInfo struct {
	Bucket  string
	Key     string
	FromUrl string
}

func (*FetchApiInfo) WorkId

func (i *FetchApiInfo) WorkId() string

type FetchResult

type FetchResult = storage.FetchRet

func Fetch

func Fetch(info FetchApiInfo) (FetchResult, *data.CodeError)

type MoveApiInfo

type MoveApiInfo struct {
	SourceBucket string
	SourceKey    string
	DestBucket   string
	DestKey      string
	Force        bool
}

func (*MoveApiInfo) ToOperation

func (m *MoveApiInfo) ToOperation() (string, *data.CodeError)

func (*MoveApiInfo) WorkId

func (m *MoveApiInfo) WorkId() string

type PreFopApiInfo

type PreFopApiInfo struct {
	Bucket      string
	Key         string
	Fops        string
	Pipeline    string
	NotifyURL   string
	NotifyForce bool
}

type RestoreArchiveApiInfo

type RestoreArchiveApiInfo struct {
	Bucket          string
	Key             string
	FreezeAfterDays int
}

func (*RestoreArchiveApiInfo) ToOperation

func (r *RestoreArchiveApiInfo) ToOperation() (string, *data.CodeError)

func (*RestoreArchiveApiInfo) WorkId

func (r *RestoreArchiveApiInfo) WorkId() string

type SaveAsApiInfo

type SaveAsApiInfo struct {
	PublicUrl  string
	SaveBucket string
	SaveKey    string
}

type StatusApiInfo

type StatusApiInfo struct {
	Bucket   string
	Key      string
	NeedPart bool
}

func (StatusApiInfo) ToOperation

func (s StatusApiInfo) ToOperation() (string, *data.CodeError)

func (StatusApiInfo) WorkId

func (s StatusApiInfo) WorkId() string

type StatusResult

type StatusResult struct {
	batch.OperationResult

	// 归档存储文件的解冻状态,uint32 类型,2表示解冻完成,1表示解冻中;归档文件冻结时,不返回该字段。
	RestoreStatus int `json:"restoreStatus"`
	// 文件状态,uint32 类型。1 表示禁用;只有禁用状态的文件才会返回该字段。
	Status int `json:"status"`
	// 文件 md5 值
	MD5 string `json:"md5"`
	// 文件过期删除日期,int64 类型,Unix 时间戳格式
	Expiration int64 `json:"expiration"`
}

func Status

func Status(info StatusApiInfo) (res StatusResult, err *data.CodeError)

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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