Versions in this module Expand all Collapse all v2 v2.0.1 Nov 9, 2023 Changes in this version type Ilog + Debugf func(format string, v ...interface{}) + Errorf func(format string, v ...interface{}) + Fatalf func(format string, v ...interface{}) + Infof func(format string, v ...interface{}) + Warnf func(format string, v ...interface{}) v2.0.0 Jul 16, 2023 Changes in this version + const CalcAndCheckCrc + const DontCheckCrc + const InvalidCtx + const LOG_LEVEL_DEBUG + const LOG_LEVEL_ERROR + const LOG_LEVEL_FATAL + const LOG_LEVEL_INFO + const LOG_LEVEL_WARN + const TypeLine + const TypeNormal + var ErrInvalidPutProgress = errors.New("invalid put progress") + var ErrMd5NotMatch = httputil.NewError(406, "md5 not match") + var ErrPutFailed = errors.New("resumable put failed") + var ErrUnmatchedChecksum = errors.New("unmatched checksum") + var MaxContinuousFailureDuration = 1 * time.Minute + var MaxContinuousFailureTimes = 5 + var MaxFindHostsPrecent = 50 + var ParseUpToken = common.ParseUpToken + func BlockCount(fsize int64) int + func MakeAuthTokenString(key, secret string, auth *AuthPolicy) string + func NewLogger() *logger + func NewSectionReader(r io.Reader, n int64) *sectionReader + func SetLogger(logger Ilog) + func SetSettings(v *Settings) + type AuthPolicy struct + Accesses []string + CallbackBody string + CallbackBodyType string + CallbackFetchKey uint16 + CallbackHost string + CallbackTimeout uint16 + CallbackUrl string + Checksum string + Cond string + CustomEventMessage string + Customer string + Deadline int64 + DeleteAfterDays uint32 + DetectMime uint16 + EndUser string + Escape uint16 + Exclusive uint16 + FileType FileType + FopTimeout uint32 + ForceInsertOnly bool + ForceSaveKey bool + FsizeLimit int64 + FsizeMin int64 + InsertOnly uint16 + IsPrefixalScope uint16 + MimeLimit string + NotifyMessage string + NotifyMessageType string + NotifyQueue string + OldFh string + PersistentNotifyUrl string + PersistentOps string + PersistentPipeline string + PutTime int64 + ReturnBody string + ReturnURL string + SaveKey string + Scope string + SignReturnBody uint16 + Transform string + type BlkputRet struct + Checksum string + Crc32 uint32 + Ctx string + Host string + Offset uint32 + type CompleteMultipart struct + CustomVars map[string]string + Fname string + Metadata map[string]string + MimeType string + Parts []Part + func (p *CompleteMultipart) Len() int + func (p *CompleteMultipart) Less(i, j int) bool + func (p *CompleteMultipart) Sort() + func (p *CompleteMultipart) Swap(i, j int) + type CompletePartsRet struct + Hash string + Key string + type FileType = common.FileType + type Ilog interface + Debug func(v ...interface{}) + Error func(v ...interface{}) + Fatal func(v ...interface{}) + Info func(v ...interface{}) + Warn func(v ...interface{}) + type Part struct + Etag string + PartNumber int + type PutExtra struct + Crc32 uint32 + Md5Trailer func() []byte + MimeType string + OnProgress func(fsize, uploaded int64) + Params map[string]string + XMeta map[string]string + type PutPolicy = common.PutPolicy + type PutRet struct + Hash string + Key string + PersistentId string + type RputExtra struct + ChunkSize int + MimeType string + Notify func(blkIdx int, blkSize int, ret *BlkputRet) + NotifyErr func(blkIdx int, blkSize int, err error) + Params map[string]string + Progresses []BlkputRet + TryTimes int + XMeta map[string]string + type Settings struct + ChunkSize int + TaskQsize int + TryTimes int + Workers int + type UploadConfig struct + Concurrency int + Transport http.RoundTripper + UpHosts []string + UpTimeout time.Duration + UploadPartSize int64 + UseBuffer bool + type UploadPartRet struct + Etag string + Md5 string + type Uploader struct + Concurrency int + Conn rpc.Client + UpHosts []string + UploadPartSize int64 + UseBuffer bool + func NewUploader(zone int, cfg *UploadConfig) (p Uploader) + func (p Uploader) Put(ctx context.Context, ret interface{}, uptoken, key string, data io.ReaderAt, ...) error + func (p Uploader) Put2(ctx context.Context, ret interface{}, uptoken, key string, data io.ReaderAt, ...) error + func (p Uploader) PutFile(ctx context.Context, ret interface{}, uptoken, key, localFile string, ...) (err error) + func (p Uploader) PutFileWithoutKey(ctx context.Context, ret interface{}, uptoken, localFile string, ...) (err error) + func (p Uploader) PutWithoutKey(ctx context.Context, ret interface{}, uptoken string, data io.ReaderAt, ...) error + func (p Uploader) Rput(ctx context.Context, ret interface{}, uptoken string, key string, ...) error + func (p Uploader) RputFile(ctx context.Context, ret interface{}, uptoken, key, localFile string, ...) (err error) + func (p Uploader) RputFileWithoutKey(ctx context.Context, ret interface{}, uptoken, localFile string, ...) (err error) + func (p Uploader) RputWithoutKey(ctx context.Context, ret interface{}, uptoken string, f io.ReaderAt, ...) error + func (p Uploader) StreamUpload(ctx context.Context, ret interface{}, uptoken, key string, reader io.Reader, ...) error + func (p Uploader) StreamUploadWithoutKey(ctx context.Context, ret interface{}, uptoken string, reader io.Reader, ...) error + func (p Uploader) Upload(ctx context.Context, ret interface{}, uptoken string, key string, ...) error + func (p Uploader) UploadWithParts(ctx context.Context, ret interface{}, uptoken string, key string, ...) error + func (p Uploader) UploadWithoutKey(ctx context.Context, ret interface{}, uptoken string, f io.ReaderAt, ...) error + func (p Uploader) UploadWithoutKeyWithParts(ctx context.Context, ret interface{}, uptoken string, f io.ReaderAt, ...) error