rs

package
v0.0.0-...-a69649c Latest Latest
Warning

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

Go to latest
Published: May 26, 2014 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeBaseUrl

func MakeBaseUrl(domain, key string) (baseUrl string)

func URICopy

func URICopy(bucketSrc, keySrc, bucketDest, keyDest string) string

func URIDelete

func URIDelete(bucket, key string) string

func URIMove

func URIMove(bucketSrc, keySrc, bucketDest, keyDest string) string

func URIStat

func URIStat(bucket, key string) string

Types

type BatchItemRet

type BatchItemRet struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

@gist batchItemRet

type BatchStatItemRet

type BatchStatItemRet struct {
	Data  Entry  `json:"data"`
	Error string `json:"error"`
	Code  int    `json:"code"`
}

@gist batchStatItemRet

type Client

type Client struct {
	Conn rpc.Client
}

func New

func New(mac *digest.Mac) Client

func NewEx

func NewEx(t http.RoundTripper) Client

func (Client) Batch

func (rs Client) Batch(l rpc.Logger, ret interface{}, op []string) (err error)

func (Client) BatchCopy

func (rs Client) BatchCopy(l rpc.Logger, entries []EntryPathPair) (ret []BatchItemRet, err error)

func (Client) BatchDelete

func (rs Client) BatchDelete(l rpc.Logger, entries []EntryPath) (ret []BatchItemRet, err error)

func (Client) BatchMove

func (rs Client) BatchMove(l rpc.Logger, entries []EntryPathPair) (ret []BatchItemRet, err error)

func (Client) BatchStat

func (rs Client) BatchStat(l rpc.Logger, entries []EntryPath) (ret []BatchStatItemRet, err error)

func (Client) Copy

func (rs Client) Copy(l rpc.Logger, bucketSrc, keySrc, bucketDest, keyDest string) (err error)

func (Client) Delete

func (rs Client) Delete(l rpc.Logger, bucket, key string) (err error)

func (Client) Move

func (rs Client) Move(l rpc.Logger, bucketSrc, keySrc, bucketDest, keyDest string) (err error)

func (Client) Stat

func (rs Client) Stat(l rpc.Logger, bucket, key string) (entry Entry, err error)

type Entry

type Entry struct {
	Hash     string `json:"hash"`
	Fsize    int64  `json:"fsize"`
	PutTime  int64  `json:"putTime"`
	MimeType string `json:"mimeType"`
	Customer string `json:"customer"`
}

@gist entry

type EntryPath

type EntryPath struct {
	Bucket string
	Key    string
}

@gist entryPath

type EntryPathPair

type EntryPathPair struct {
	Src  EntryPath
	Dest EntryPath
}

@gist entryPathPair

type GetPolicy

type GetPolicy struct {
	Expires uint32
}

func (GetPolicy) MakeRequest

func (r GetPolicy) MakeRequest(baseUrl string, mac *digest.Mac) (privateUrl string)

type PutPolicy

type PutPolicy struct {
	Scope               string `json:"scope"`
	Expires             uint32 `json:"deadline"`             // 截止时间(以秒为单位)
	InsertOnly          uint16 `json:"exclusive,omitempty"`  // 若非0, 即使Scope为 Bucket:Key 的形式也是insert only
	DetectMime          uint16 `json:"detectMime,omitempty"` // 若非0, 则服务端根据内容自动确定 MimeType
	FsizeLimit          int64  `json:"fsizeLimit,omitempty"`
	SaveKey             string `json:"saveKey,omitempty"`
	CallbackUrl         string `json:"callbackUrl,omitempty"`
	CallbackBody        string `json:"callbackBody,omitempty"`
	ReturnUrl           string `json:"returnUrl,omitempty"`
	ReturnBody          string `json:"returnBody,omitempty"`
	PersistentOps       string `json:"persistentOps,omitempty"`
	PersistentNotifyUrl string `json:"persistentNotifyUrl,omitempty"`
	AsyncOps            string `json:"asyncOps,omitempty"`
	EndUser             string `json:"endUser,omitempty"`
}

func (*PutPolicy) Token

func (r *PutPolicy) Token(mac *digest.Mac) string

Jump to

Keyboard shortcuts

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