Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeOut = 5 * time.Second SlowRequest = 2 * time.Second )
View Source
const ( PathListSeparator = ";" CacheConfSeparator = ":" BlockLimit = 10000 SpaceLimit = 85 SpaceCheckInterval = 60 * time.Second TmpFileCheckInterval = 20 * 60 * time.Second FilePerm = 0644 Basedir = "blocks" )
View Source
const ( UnixSocketPath = "/var/lib/adls/bcache.socket" CacheKey = "cachekey" CheckSum = "md5sum" OffSet = "offset" Len = "len" Volume = "volume" ContextKeyStatusCode = "status_code" ContextKeyErrorMessage = "error_message" ContextKeyRequestID = "ctx_request_id" //config CacheDir = "cacheDir" CacheSize = "cacheSize" CacheLimit = "cacheLimit" CacheFree = "cacheFree" BlockSize = "blockSize" MaxBlockSize = 128 << 20 )
Variables ¶
View Source
var ( BadDigest = &ErrorCode{ErrorCode: "BadDigest", ErrorMessage: "The Content-MD5 you specified did not match what we received.", StatusCode: http.StatusBadRequest} KeyTooLongError = &ErrorCode{ErrorCode: "KeyTooLongError", ErrorMessage: "", StatusCode: http.StatusBadRequest} InvalidKey = &ErrorCode{ErrorCode: "InvalidKey", ErrorMessage: "Cache key is Illegal", StatusCode: http.StatusBadRequest} EntityTooLarge = &ErrorCode{ErrorCode: "EntityTooLarge", ErrorMessage: "Your proposed upload exceeds the maximum allowed object size.", StatusCode: http.StatusBadRequest} InvalidArgument = &ErrorCode{ErrorCode: "InvalidArgument", ErrorMessage: "Invalid Argument,cachekey|md5|offsetlen is required.", StatusCode: http.StatusBadRequest} InvalidNumber = &ErrorCode{ErrorCode: "InvalidNumber", ErrorMessage: "Invalid Argument type,need number .", StatusCode: http.StatusBadRequest} NoSuchCacheKey = &ErrorCode{ErrorCode: "NoSuchCacheKey", ErrorMessage: "The specified cache key does not exist.", StatusCode: http.StatusNotFound} ReadStreamError = &ErrorCode{ErrorCode: "ReadStreamError", ErrorMessage: "Read body stream unknown exception.", StatusCode: http.StatusBadRequest} InternalError = &ErrorCode{ErrorCode: "InternalError", ErrorMessage: "Server interval error.", StatusCode: http.StatusInternalServerError} )
Functions ¶
func AccessTime ¶
Types ¶
type BcacheClient ¶
type BcacheClient struct {
// contains filtered or unexported fields
}
func NewBcacheClient ¶
func NewBcacheClient() *BcacheClient
func (*BcacheClient) Evict ¶
func (bc *BcacheClient) Evict(key string)
type BcacheManager ¶
type BcacheManager interface {
// contains filtered or unexported methods
}
type DiskStore ¶
func NewDiskStore ¶
type ErrorCode ¶
func (ErrorCode) ServeResponse ¶
Click to show internal directories.
Click to hide internal directories.