Documentation
¶
Index ¶
- Constants
- type CacheFlag
- type ID
- func (id *ID) Bytes() []byte
- func (id *ID) Ext() string
- func (id *ID) Hash() IDHash
- func (id *ID) HashStr() string
- func (id *ID) Key() string
- func (id *ID) MarshalCBOR() ([]byte, error)
- func (id *ID) MarshalJSON() ([]byte, error)
- func (id *ID) Path() string
- func (id *ID) String() string
- func (id *ID) UnmarshalCBOR(buf []byte) error
- func (id *ID) UnmarshalJSON(buf []byte) error
- func (id *ID) WPath(pwd string) string
- func (id *ID) WPathSlice(pwd string, sliceIndex uint32) string
- type IDHash
- type IDSliceHash
- type Metadata
Constants ¶
View Source
const IdHashSize = sha1.Size
IdHashSize is the size of the byte array that contains the object hash.
View Source
const IdSliceHashSize = IdHashSize + 4
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
func NewVirtualID ¶
func (*ID) MarshalCBOR ¶
MarshalCBOR implements cbor.Marshaler.
func (*ID) MarshalJSON ¶
func (*ID) UnmarshalCBOR ¶
UnmarshalCBOR implements cbor.Unmarshaler.
func (*ID) UnmarshalJSON ¶
type IDHash ¶
type IDHash [IdHashSize]byte
IDHash is the fixed-width byte array that represents an ObjectID hash.
type IDSliceHash ¶
type IDSliceHash [IdSliceHashSize]byte
type Metadata ¶
type Metadata struct {
Flags CacheFlag `json:"flags"`
ID *ID `json:"id"` // object ID
BlockSize uint64 `json:"bsize"` // block size
Chunks bitmap.Bitmap `json:"chunks"` // file chunk
Parts bitmap.Bitmap `json:"parts"` // file chunk parts
Code int `json:"code"` // http response code
Size uint64 `json:"size"` // object size
RespUnix int64 `json:"resp_unix"` // response time
LastRefUnix int64 `json:"last_ref_unix"` // last reference time
Refs int64 `json:"refs"` // reference count
ExpiresAt int64 `json:"expires_at"` // expiration time
Headers http.Header `json:"headers"` // http headers
VirtualKey []string `json:"vkey,omitempty"` // vary keys
}
func (*Metadata) HasComplete ¶
func (*Metadata) IsVaryCache ¶
IsVaryCache returns true if the metadata is a vary-cache metadata.
func (*Metadata) IsVaryChunked ¶
IsVaryChunked returns true if the metadata is a vary-cache-chunked metadata.
Click to show internal directories.
Click to hide internal directories.