API_HOST_TELECOM = 1
API_HOST_NETCOM = 2
API_HOST_RAILCOM = 3
API_HOST_AUTO = 4
UPAIYUN_API_HOSTS = {
        API_HOST_AUTO: 'v0.api.upyun.com',
        API_HOST_TELECOM: 'v1.api.upyun.com',
        API_HOST_NETCOM: 'v2.api.upyun.com',
        API_HOST_RAILCOM: 'v3.api.upyun.com',
        }

SPACE_TYPE_FILE = 1
SPACE_TYPE_IMAGE = 2

BUCKET_DOMAIN = '%s.b0.upaiyun.com'

HEADER_UPYUN_PREFIX = 'x-upyun-'
HEADER_THUMB_PREFIX = 'x-gmkerl-'
HEADER_THUMB_VERSION = HEADER_THUMB_PREFIX + 'thumbnail'
HEADER_THUMB_TYPE = HEADER_THUMB_PREFIX + 'type'
HEADER_THUMB_VALUE = HEADER_THUMB_PREFIX + 'value'
HEADER_THUMB_QUALITY = HEADER_THUMB_PREFIX + 'quality'
HEADER_THUMB_UNSHARP = HEADER_THUMB_PREFIX + 'unsharp'
HEADER_MKDIR = 'Mkdir'
HEADER_MD5 = 'Content-MD5'
HEADER_SECRET = 'Content-Secret'
HEADER_FOLDER = 'Folder'

THUMB_TYPE_FIX_MAX = 1
THUMB_TYPE_FIX_WIDTH_OR_HEIGHT = 2
THUMB_TYPE_FIX_WIDTH = 3
THUMB_TYPE_FIX_HEIGHT = 4
THUMB_TYPE_SQUARE = 5
THUMB_TYPE_FIX_BOTH = 6
THUMB_TYPES = {
        THUMB_TYPE_FIX_MAX: 'fix_max',
        THUMB_TYPE_FIX_WIDTH_OR_HEIGHT: 'fix_width_or_height',
        THUMB_TYPE_FIX_WIDTH: 'fix_width',
        THUMB_TYPE_FIX_HEIGHT: 'fix_height',
        THUMB_TYPE_SQUARE: 'square',
        THUMB_TYPE_FIX_BOTH: 'fix_both',
        }

FILE_TYPE_FILE = 1
FILE_TYPE_FOLDER = 2
