qshell

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_DOWNLOAD_THREAD_COUNT = 1
	MAX_DOWNLOAD_THREAD_COUNT = 100
)
View Source
const (
	BLOCK_BITS = 22 // Indicate that the blocksize is 4M
	BLOCK_SIZE = 1 << BLOCK_BITS
)
View Source
const (
	PUT_THRESHOLD           int64 = 100 * 1 << 20
	MIN_UPLOAD_THREAD_COUNT int64 = 1
	MAX_UPLOAD_THREAD_COUNT int64 = 100
)

Variables

This section is empty.

Functions

func BlockCount added in v1.3.7

func BlockCount(fsize int64) int

func CalSha1 added in v1.3.7

func CalSha1(b []byte, r io.Reader) ([]byte, error)

func CheckQrsync

func CheckQrsync(dirCacheResultFile string, listBucketResultFile string, ignoreLocalDir bool, prefix string)

func GetEtag added in v1.3.7

func GetEtag(filename string) (etag string, err error)

func Prefetch

func Prefetch(mac *digest.Mac, bucket, key string) (err error)

func PrivateUrl added in v1.3.7

func PrivateUrl(mac *digest.Mac, publicUrl string, deadline int64) string

func QiniuDownload added in v1.3.2

func QiniuDownload(threadCount int, downloadConfigFile string)

func QiniuUpload

func QiniuUpload(threadCount int, uploadConfigFile string)

func Saveas added in v1.3.9

func Saveas(mac *digest.Mac, publicUrl string, saveBucket string, saveKey string) (string, error)

func Unzip added in v1.3.7

func Unzip(zipFilePath string, unzipPath string) (err error)

Types

type Account

type Account struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
}

func (*Account) Get

func (this *Account) Get()

func (*Account) Set

func (this *Account) Set(accessKey string, secretKey string)

func (*Account) String

func (this *Account) String() string

func (*Account) ToJson

func (this *Account) ToJson() (jsonStr string)

type AliListBucket

type AliListBucket struct {
	DataCenter      string
	AccessKeyId     string
	AccessKeySecret string
	Bucket          string
	Prefix          string
}

func (*AliListBucket) ListBucket

func (this *AliListBucket) ListBucket(listResultFile string) (err error)

type BatchItemRet added in v1.3.9

type BatchItemRet struct {
	Code int              `json:"code"`
	Data BatchItemRetData `json:"data"`
}

func BatchChgm added in v1.3.9

func BatchChgm(client rs.Client, entries []ChgmEntryPath) (ret []BatchItemRet, err error)

func BatchDelete added in v1.3.9

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

func BatchMove added in v1.3.9

func BatchMove(client rs.Client, entries []MoveEntryPath) (ret []BatchItemRet, err error)

func BatchRename added in v1.3.9

func BatchRename(client rs.Client, entries []RenameEntryPath) (ret []BatchItemRet, err error)

type BatchItemRetData added in v1.3.9

type BatchItemRetData struct {
	Error string `json:"error,omitempty"`
}

type ChgmEntryPath added in v1.3.9

type ChgmEntryPath struct {
	Bucket   string
	Key      string
	MimeType string
}

type DirCache

type DirCache struct {
}

func (*DirCache) Cache

func (this *DirCache) Cache(cacheRootPath string, cacheResultFile string) (fileCount int)

type DownloadConfig added in v1.3.2

type DownloadConfig struct {
	DestDir   string `json:"dest_dir"`
	Bucket    string `json:"bucket"`
	Domain    string `json:"domain"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	IsPrivate bool   `json:"is_private"`
	Prefix    string `json:"prefix,omitempty"`
}

type FetchResult added in v1.3.9

type FetchResult struct {
	Key  string `json:"key"`
	Hash string `json:"hash"`
}

func Fetch

func Fetch(mac *digest.Mac, remoteResUrl, bucket, key string) (fetchResult FetchResult, err error)

type FopResult

type FopResult struct {
	Cmd   string   `json:"cmd"`
	Code  int      `json:"code"`
	Desc  string   `json:"desc"`
	Error string   `json:"error,omitempty"`
	Hash  string   `json:"hash,omitempty"`
	Key   string   `json:"key,omitempty"`
	Keys  []string `json:"keys,omitempty"`
}

type FopRet

type FopRet struct {
	Id          string `json:"id"`
	Code        int    `json:"code"`
	Desc        string `json:"desc"`
	InputBucket string `json:"inputBucket,omitempty"`
	InputKey    string `json:"inputKey,omitempty"`
	Pipeline    string `json:"pipeline,omitempty"`
	Reqid       string `json:"reqid,omitempty"`
	Items       []FopResult
}

func (*FopRet) String

func (this *FopRet) String() string

type ListBucket

type ListBucket struct {
	Account
}

func (*ListBucket) List

func (this *ListBucket) List(bucket string, prefix string, listResultFile string) (retErr error)

type MoveEntryPath added in v1.3.9

type MoveEntryPath struct {
	SrcBucket  string
	DestBucket string
	SrcKey     string
	DestKey    string
}

type RSFop

type RSFop struct {
	Account
}

func (*RSFop) Prefop

func (this *RSFop) Prefop(persistentId string, fopRet *FopRet) (err error)

type RenameEntryPath added in v1.3.9

type RenameEntryPath struct {
	Bucket string
	OldKey string
	NewKey string
}

type UploadConfig

type UploadConfig struct {
	SrcDir    string `json:"src_dir"`
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Bucket    string `json:"bucket"`
	KeyPrefix string `json:"key_prefix,omitempty"`
	IgnoreDir bool   `json:"ignore_dir,omitempty"`
	Overwrite bool   `json:"overwrite,omitempty"`
}

Jump to

Keyboard shortcuts

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