qiniu

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackRequestBody

type CallbackRequestBody struct {
	Id          string  `json:"id"`          // persistentId 持久化任务 id
	Code        int     `json:"code"`        // 持久化任务执行结果码
	Desc        string  `json:"desc"`        // 持久化任务执行结果说明
	InputKey    string  `json:"inputKey"`    // 持久化任务输入的文件
	InputBucket string  `json:"inputBucket"` // 持久化任务输入的存储空间
	Pipeline    string  `json:"pipeline"`    // 持久化任务执行使用 pipeline
	Reqid       string  `json:"reqid"`       // 请求 id
	Items       []*Item `json:"items"`       // 持久化任务执行的子项
}

CallbackRequestBody 七牛云持久化任务回调请求的 body

type Config

type Config struct {
	UseHttps      bool
	UseCdnDomains bool
	CentralRsHost string
	NotifyUrl     string
	Pipeline      string
}

type FopConfig

type FopConfig struct {
	Fops    []string
	Force   bool
	FileKey string
}

type Item

type Item struct {
	Cmd       string `json:"cmd"`       // 任务子项的命令
	Code      int    `json:"code"`      // 任务子项执行的结果码
	Desc      string `json:"desc"`      // 任务子项执行结果说明
	Error     string `json:"error"`     // 任务子项执行失败时详细原因
	Hash      string `json:"hash"`      // 处理结果保存在七牛云的唯一 hash 标识
	Key       string `json:"key"`       // 处理结果的外链资源名称
	ReturnOld int    `json:"returnOld"` // 默认为 0, 当用户执行 saveas 且未加 force 且指定的 bucket 中已存在 key 时则返回 1,告知用户返回的是旧数据
}

Item 七牛云持久化处理的操作列表, 包含每个操作的状态信息

type Option

type Option func(*Options)

func WithAccess

func WithAccess(access string) Option

func WithBucket

func WithBucket(bucket string) Option

func WithDomain

func WithDomain(domain string) Option

func WithOperationConf

func WithOperationConf(conf *Config) Option

func WithPrivate

func WithPrivate(private bool) Option

func WithSecret

func WithSecret(secret string) Option

func WithStorageConfig

func WithStorageConfig(config *Config) Option

func WithTTL

func WithTTL(ttl time.Duration) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

type PfopItem

type PfopItem struct {
	Cmd       string `json:"cmd"`       // 任务的单个执行元素的指令
	Code      int    `json:"code"`      // 指令执行状态码
	Desc      string `json:"desc"`      // 指令执行结果说明
	Error     string `json:"error"`     // 指令执行错误说明
	Hash      string `json:"hash"`      // 指令的 HASH 值
	Key       string `json:"key"`       // 运处理结果的外链资源名 Key
	ReturnOld string `json:"returnOld"` // 默认为0。当用户执行saveas时,如果未加force且指定的bucket:key存在,则返回1 ,告诉用户返回的是旧数据。
}

type PfopResponse

type PfopResponse struct {
	Id          string      `json:"id"`          // 任务 ID
	Code        int         `json:"code"`        // 任务状态
	Desc        string      `json:"desc"`        // 执行结果说明
	InputKey    string      `json:"inputKey"`    // 任务输入文件的 key
	InputBucket string      `json:"inputBucket"` // 任务输入文件存储空间
	Items       []*PfopItem `json:"items"`       // 云处理指令列表,包含每个云处理操作的状态信息
	Pipeline    string      `json:"pipeline"`    // 云处理操作的处理队列, 默认使用队列为共享队列 0.default
	Reqid       string      `json:"reqid"`       // 云处理请求 ID
}

func ParsePfopResponse

func ParsePfopResponse(reqBody []byte) (*PfopResponse, error)

type Qiniu

type Qiniu struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Qiniu

func (*Qiniu) EncodeEntry

func (qiniu *Qiniu) EncodeEntry(fileName string) string

func (*Qiniu) MakePrivateURL

func (qiniu *Qiniu) MakePrivateURL(domain, key string, deadline int64) string

MakePrivateURL 获取私有文件的下载链接地址

func (*Qiniu) MakePrivateURLWithQuery

func (qiniu *Qiniu) MakePrivateURLWithQuery(domain, key string, query url.Values, deadline int64) string

func (*Qiniu) MakePrivateURLWithQueryString

func (qiniu *Qiniu) MakePrivateURLWithQueryString(domain, key, query string, deadline int64) string

func (*Qiniu) Mkzip added in v1.2.6

func (qiniu *Qiniu) Mkzip(mode int, files []string, zipFile string) string

func (*Qiniu) Pfop

func (qiniu *Qiniu) Pfop(config *FopConfig) (string, error)

func (*Qiniu) Provide

func (qiniu *Qiniu) Provide(ctx context.Context) interface{}

func (*Qiniu) UploadToken

func (qiniu *Qiniu) UploadToken(keys ...string) string

Jump to

Keyboard shortcuts

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