constants

package
v2.0.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 3 Imported by: 13

Documentation

Index

Constants

View Source
const (
	Path         = "~/.qscamel"
	ConfigPath   = Path + "/qscamel.yaml"
	DatabasePath = Path + "/db"
	LogPath      = Path + "/qscamel.log"
	PIDPath      = Path + "/qscamel.pid"
)

Path store all path related constants.

View Source
const (
	EndpointAliyun   = "aliyun"
	EndpointFileList = "filelist"
	EndpointFs       = "fs"
	EndpointGCS      = "gcs"
	EndpointQingStor = "qingstor"
	EndpointQiniu    = "qiniu"
	EndpointS3       = "s3"
	EndpointUpyun    = "upyun"
)

Endpoint the const for all supported endpoint.

View Source
const (
	SourceEndpoint uint8 = iota
	DestinationEndpoint
)

Constants for endpoint type.

View Source
const (
	TaskTypeCopy   = "copy"
	TaskTypeDelete = "delete"
	TaskTypeFetch  = "fetch"
)

Constants for task type.

View Source
const (
	TaskStatusCreated  = "created"
	TaskStatusRunning  = "running"
	TaskStatusFinished = "finished"
)

Constants for task status.

View Source
const (
	TaskIgnoreExistingLastModified = "last_modified"
	TaskIgnoreExistingMD5Sum       = "md5sum"
)

Constants for task ignore existing config.

View Source
const (
	ObjectTypeDirectory = "directory"
	ObjectTypeSingle    = "single"
	ObjectTypePartial   = "partial"
)

Constants for object types.

View Source
const (
	KeyTaskPrefix = "t:"

	// ObjectPrefixKey `~` is bigger than all ascii printable characters.
	ObjectPrefixKey = "~"

	KeyDirectoryObjectPrefix = "do:"
	KeySingleObjectPrefix    = "so:"
	KeyPartialObjectPrefix   = "po:"
)

Constants for database key.

View Source
const (
	Name             = "qscamel"
	ShortDescription = "A command line tool to migrate data"
	LongDescription  = "qscamel is a command line tool to migrate data between different endpoint efficiently."
)

Name stores all name related const.

View Source
const DefaultConfigContent = `` /* 126-byte string literal not displayed */

DefaultConfigContent is the default config config.

View Source
const DefaultMultipartBoundarySize = 2147483648

DefaultMultipartBoundarySize is the default multipart boundary size. 2 * 1024 * 1024 * 1024 = 2147483648 B = 2 GB

View Source
const Version = "2.0.5"

Version number string.

Variables

View Source
var (
	// ErrTaskInvalid is returned when this task is invalid.
	ErrTaskInvalid = errors.New("task is invalid")
	// ErrTaskMismatch is returned when task content has been changed.
	ErrTaskMismatch = errors.New("task content mismatch")
	// ErrTaskNotFinished is returned when task is not finished.
	ErrTaskNotFinished = errors.New("task not finished")
	// ErrTaskNotFound is returned when task is not found.
	ErrTaskNotFound = errors.New("task not found")

	// ErrEndpointInvalid is returned when this endpoint is invalid.
	ErrEndpointInvalid = errors.New("endpoint is invalid")
	// ErrEndpointNotSupported is returned when this endpoint is not supported.
	ErrEndpointNotSupported = errors.New("endpoint type is not supported")
	// ErrEndpointFuncNotImplemented is return when a not implement function is called.
	ErrEndpointFuncNotImplemented = errors.New("endpoint does not implement this function")

	// ErrObjectTooLarge is returned when the object is too large.
	ErrObjectTooLarge = errors.New("object is too large")
	// ErrObjectInvalid is returned when the object is invalid.
	ErrObjectInvalid = errors.New("object is invalid")
)

These errors can be returned when handle task.

View Source
var (
	// DefaultConcurrency is default num of objects being migrated concurrently.
	DefaultConcurrency = runtime.NumCPU() * 10
)

Functions

func FormatDirectoryObjectKey

func FormatDirectoryObjectKey(t, s string) []byte

FormatDirectoryObjectKey will format a directory object key.

func FormatPartialObjectKey

func FormatPartialObjectKey(t, s string, partNumber int) []byte

FormatPartialObjectKey will format a partial object key.

func FormatSingleObjectKey

func FormatSingleObjectKey(t, s string) []byte

FormatSingleObjectKey will format a single object key.

func FormatTaskKey

func FormatTaskKey(t string) []byte

FormatTaskKey will format a task key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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