Documentation
¶
Index ¶
- Variables
- func CacheKey(u uuid.UUID) string
- type ChunkRef
- func (c ChunkRef) CacheKey() string
- func (c *ChunkRef) DecodeBytes(by []byte) error
- func (c *ChunkRef) EncodeBytes() ([]byte, error)
- func (c *ChunkRef) Load(ps []datastore.Property) error
- func (c *ChunkRef) LoadKey(k *datastore.Key) error
- func (c *ChunkRef) ObjectPath() string
- func (c *ChunkRef) Save() ([]datastore.Property, error)
- func (c *ChunkRef) ToProto() *pb.ChunkMetadata
- type ChunkRefCursor
Constants ¶
This section is empty.
Variables ¶
var (
ErrIteratorNil = blobref.ErrIteratorNil
)
Functions ¶
Types ¶
type ChunkRef ¶
type ChunkRef struct { // Key is the primary key of the ChunkRef. Key uuid.UUID `datastore:"-"` // BlobRef is the key of parent BlobRef. BlobRef uuid.UUID `datastore:"-"` // Number is the position of the chunk in the BlobRef. Number int32 // Size is the byte size of the chunk. Size int32 // Status is the current status of the chunk. blobref.Status // Checksums contains checksums for the chunk object. checksums.Checksums `datastore:",flatten"` // Timestamps keeps track of creation and modification times and stores a randomly // generated UUID to maintain consistency. Timestamps timestamps.Timestamps }
ChunkRef is a metadata entity to keep track of chunks stored in an external blob store. It is a child entity of and always associated to a BlobRef.
func (ChunkRef) CacheKey ¶
CacheKey returns a cache key string to store in the cache. It returns a string representation of the uuid key.
func (*ChunkRef) DecodeBytes ¶
DecodeBytes deserializes the byte slice given by by.
func (*ChunkRef) EncodeBytes ¶
EncodeBytes returns a serialized byte slice of the object.
func (*ChunkRef) Load ¶
Load implements the Datastore PropertyLoadSaver interface and converts Datastore properties to corresponding struct fields.
func (*ChunkRef) ObjectPath ¶
func (*ChunkRef) Save ¶
Save implements the Datastore PropertyLoadSaver interface and converts struct fields to Datastore properties.
func (*ChunkRef) ToProto ¶
func (c *ChunkRef) ToProto() *pb.ChunkMetadata
ToProto converts returns a pb.ChunkMetadata representation of the ChunkRef object.
type ChunkRefCursor ¶
type ChunkRefCursor struct {
// contains filtered or unexported fields
}
ChunkRefCursor is a database cursor for ChunkRef.
func NewCursor ¶
func NewCursor(i *ds.Iterator) *ChunkRefCursor
func (*ChunkRefCursor) Next ¶
func (i *ChunkRefCursor) Next() (*ChunkRef, error)
Next advances the iterator and returns the next value. Returns nil and and iterator.Done at the end of the iterator. Returns ErrIteratorNil if the iterator is nil.