Documentation ¶
Index ¶
- Variables
- func AlignLinux(input ...[]string) [][]string
- func AlignPrintWithColon(s ...string) string
- func CalculatePartSize(size int64) (partSize int64, err error)
- func ChooseDestinationStorage(x interface{ ... }, y interface{ ... })
- func ChooseSourceStorage(x interface{ ... }, y interface{ ... })
- func NewQingStorService() (*qingstor.Service, error)
- func NewRand() io.Reader
- func NewRandFrom(src rand.Source) io.Reader
- func ParseAtServiceInput(t interface{ ... }) (err error)
- func ParseAtStorageInput(t interface{ ... }, input string) (err error)
- func ParseBetweenStorageInput(t interface{ ... }, src, dst string) (err error)
- func ParseByteSize(s string) (int64, error)
- func ParseFlow(src, dst string) (flow constants.FlowType)
- func ParseLocalPath(p string) (pathType typ.ObjectType, err error)
- func ParseQsPath(p string) (keyType typ.ObjectType, bucketName, objectKey string, err error)
- func ParseServiceInput(serviceType typ.ServicerType) (service storage.Servicer, err error)
- func ParseStorageInput(input string, storageType typ.StoragerType) (path string, objectType typ.ObjectType, store storage.Storager, err error)
- func UnixReadableSize(hrSize string) (string, error)
- type CallbackTask
- type EmptyTask
Constants ¶
This section is empty.
Variables ¶
var ErrReadableSizeFormat = errors.New("readable size format invalid")
ErrReadableSizeFormat will return when size format not the same with expected.
Functions ¶
func AlignLinux ¶
AlignLinux will align print by lines (element in slice)
func AlignPrintWithColon ¶
AlignPrintWithColon will align print with ":"
func CalculatePartSize ¶
CalculatePartSize will calculate the object's part size.
func ChooseDestinationStorage ¶
func ChooseDestinationStorage(x interface { types.PathSetter types.StorageSetter }, y interface { types.DestinationPathGetter types.DestinationStorageGetter })
ChooseDestinationStorage will choose the destination storage to fill.
func ChooseSourceStorage ¶
func ChooseSourceStorage(x interface { types.PathSetter types.StorageSetter }, y interface { types.SourcePathGetter types.SourceStorageGetter })
ChooseSourceStorage will choose the source storage to fill.
func NewQingStorService ¶
NewQingStorService will create a new qingstor service.
func NewRandFrom ¶
NewRandFrom creates a new reader from your own rand.Source
func ParseAtServiceInput ¶
func ParseAtServiceInput(t interface { types.ServiceSetter }) (err error)
ParseAtServiceInput will parse single args and setup service.
func ParseAtStorageInput ¶
func ParseAtStorageInput(t interface { types.PathSetter types.StorageSetter types.TypeSetter }, input string) (err error)
ParseAtStorageInput will parse single args and setup path, type, storager.
func ParseBetweenStorageInput ¶
func ParseBetweenStorageInput(t interface { types.SourcePathSetter types.SourceStorageSetter types.SourceTypeSetter types.DestinationPathSetter types.DestinationStorageSetter types.DestinationTypeSetter }, src, dst string) (err error)
ParseBetweenStorageInput will parse two args into flow, path and key.
func ParseByteSize ¶
ParseByteSize will tried to parse string to byte size.
func ParseLocalPath ¶
func ParseLocalPath(p string) (pathType typ.ObjectType, err error)
ParseLocalPath will parse a path into different path type.
func ParseQsPath ¶
func ParseQsPath(p string) (keyType typ.ObjectType, bucketName, objectKey string, err error)
ParseQsPath will parse a key into different key type.
func ParseServiceInput ¶
func ParseServiceInput(serviceType typ.ServicerType) (service storage.Servicer, err error)
ParseServiceInput will parse service input.
func ParseStorageInput ¶
func ParseStorageInput(input string, storageType typ.StoragerType) (path string, objectType typ.ObjectType, store storage.Storager, err error)
ParseStorageInput will parse storage input and return a initiated storager.
func UnixReadableSize ¶
UnixReadableSize will transfer readable size string into Unix size. 1 KB --> 1B, 1.2 GB --> 1.2G, 103 B --> 103B
Types ¶
type CallbackTask ¶
type CallbackTask struct { types.ID types.Fault types.Pool // contains filtered or unexported fields }
CallbackTask is the callback task.
func NewCallbackTask ¶
func NewCallbackTask(fn func()) *CallbackTask
NewCallbackTask will create a new callback test.