Documentation ¶
Index ¶
- Constants
- Variables
- func BlockCount(fsize int64) int
- func Blockput(c rpc.Client, l rpc.Logger, ret *BlkputRet, body io.Reader, size int) error
- func Mkblock(c rpc.Client, l rpc.Logger, ret *BlkputRet, blockSize int, body io.Reader, ...) error
- func Mkfile(c rpc.Client, l rpc.Logger, ret interface{}, key string, hasKey bool, ...) (err error)
- func NewClient(token string, bindRemoteIp string) rpc.Client
- func NewClientEx(token string, transport http.RoundTripper, bindRemoteIp string) rpc.Client
- func Put(c rpc.Client, l rpc.Logger, ret interface{}, key string, f io.ReaderAt, ...) error
- func PutFile(c rpc.Client, l rpc.Logger, ret interface{}, key, localFile string, ...) (err error)
- func PutFileWithoutKey(c rpc.Client, l rpc.Logger, ret interface{}, localFile string, extra *PutExtra) (err error)
- func PutWithoutKey(c rpc.Client, l rpc.Logger, ret interface{}, f io.ReaderAt, fsize int64, ...) error
- func ResumableBlockput(c rpc.Client, l rpc.Logger, ret *BlkputRet, f io.ReaderAt, blkIdx, blkSize int, ...) (err error)
- func SetSettings(v *Settings)
- type BlkputRet
- type ProgressRecord
- type PutExtra
- type PutRet
- type Settings
- type Transport
Constants ¶
View Source
const (
InvalidCtx = 701 // UP: 无效的上下文(bput),可能情况:Ctx非法或者已经被淘汰(太久未使用)
)
Variables ¶
View Source
var ErrInvalidPutProgress = errors.New("invalid put progress")
View Source
var ErrPutFailed = errors.New("resumable put failed")
View Source
var ErrUnmatchedChecksum = errors.New("unmatched checksum")
Functions ¶
func BlockCount ¶
func NewClientEx ¶
func PutFileWithoutKey ¶
func PutWithoutKey ¶
func ResumableBlockput ¶
func SetSettings ¶
func SetSettings(v *Settings)
Types ¶
type ProgressRecord ¶ added in v1.6.2
type ProgressRecord struct {
Progresses []BlkputRet `json:"progresses"`
}
type PutExtra ¶
type PutExtra struct { Params map[string]string // 可选。用户自定义参数,以"x:"开头 否则忽略 MimeType string // 可选。 ChunkSize int // 可选。每次上传的Chunk大小 TryTimes int // 可选。尝试次数 Progresses []BlkputRet // 可选。上传进度 ProgressFile string //可选。块级断点续传进度保存文件 Notify func(blkIdx int, blkSize int, ret *BlkputRet) // 可选。进度提示(注意多个block是并行传输的) NotifyErr func(blkIdx int, blkSize int, err error) }
@gist PutExtra
Click to show internal directories.
Click to hide internal directories.