Documentation ¶
Index ¶
- Constants
- func GetReferenceLookup(allocationID string, path string) string
- type Attributes
- type Collaborator
- type CommitMetaTxn
- type FileRef
- func (fr *FileRef) CalculateHash() string
- func (fr *FileRef) GetAttributes() Attributes
- func (fr *FileRef) GetCreatedAt() string
- func (fr *FileRef) GetHash() string
- func (fr *FileRef) GetHashData() string
- func (fr *FileRef) GetLookupHash() string
- func (fr *FileRef) GetName() string
- func (fr *FileRef) GetNumBlocks() int64
- func (fr *FileRef) GetPath() string
- func (fr *FileRef) GetPathHash() string
- func (fr *FileRef) GetSize() int64
- func (fr *FileRef) GetType() string
- func (fr *FileRef) GetUpdatedAt() string
- type ListResult
- type Ref
- func (r *Ref) AddChild(child RefEntity)
- func (r *Ref) CalculateHash() string
- func (r *Ref) GetAttributes() Attributes
- func (r *Ref) GetCreatedAt() string
- func (r *Ref) GetHash() string
- func (r *Ref) GetLookupHash() string
- func (r *Ref) GetName() string
- func (r *Ref) GetNumBlocks() int64
- func (r *Ref) GetPath() string
- func (r *Ref) GetPathHash() string
- func (r *Ref) GetSize() int64
- func (r *Ref) GetType() string
- func (r *Ref) GetUpdatedAt() string
- func (r *Ref) RemoveChild(idx int)
- type RefEntity
- type ReferencePath
Constants ¶
View Source
const ( FILE = "f" DIRECTORY = "d" )
View Source
const CHUNK_SIZE = 64 * 1024
Variables ¶
This section is empty.
Functions ¶
func GetReferenceLookup ¶
Types ¶
type Attributes ¶
type Attributes struct { // The WhoPaysForReads represents reading payer. It can be allocation owner // or a 3rd party user. It affects read operations only. It requires // blobbers to be trusted. WhoPaysForReads common.WhoPays `json:"who_pays_for_reads,omitempty"` }
The Attributes represents file attributes.
func (*Attributes) IsZero ¶
func (a *Attributes) IsZero() bool
IsZero returns true, if the Attributes is zero.
type Collaborator ¶
type CommitMetaTxn ¶
type FileRef ¶
type FileRef struct { Ref `json:",squash"` CustomMeta string `json:"custom_meta"` ContentHash string `json:"content_hash"` MerkleRoot string `json:"merkle_root"` ThumbnailSize int64 `json:"thumbnail_size"` ThumbnailHash string `json:"thumbnail_hash"` ActualFileSize int64 `json:"actual_file_size"` ActualFileHash string `json:"actual_file_hash"` ActualThumbnailSize int64 `json:"actual_thumbnail_size"` ActualThumbnailHash string `json:"actual_thumbnail_hash"` MimeType string `json:"mimetype"` EncryptedKey string `json:"encrypted_key"` CommitMetaTxns []CommitMetaTxn `json:"commit_meta_txns"` Collaborators []Collaborator `json:"collaborators"` Attributes Attributes `json:"attributes"` }
func (*FileRef) CalculateHash ¶
func (*FileRef) GetAttributes ¶
func (fr *FileRef) GetAttributes() Attributes
func (*FileRef) GetCreatedAt ¶
func (*FileRef) GetHashData ¶
func (*FileRef) GetLookupHash ¶
func (*FileRef) GetNumBlocks ¶
func (*FileRef) GetPathHash ¶
func (*FileRef) GetUpdatedAt ¶
type ListResult ¶
type ListResult struct { AllocationRoot string `json:"allocation_root"` Meta map[string]interface{} `json:"meta_data"` Entities []map[string]interface{} `json:"list"` }
func (*ListResult) GetDirTree ¶
func (lr *ListResult) GetDirTree(allocationID string) (*Ref, error)
type Ref ¶
type Ref struct { Type string `json:"type"` AllocationID string `json:"allocation_id"` Name string `json:"name"` Path string `json:"path"` Size int64 `json:"size"` ActualSize int64 `json:"actual_file_size"` Hash string `json:"hash"` ChunkSize int64 `json:"chunk_size"` NumBlocks int64 `json:"num_of_blocks"` PathHash string `json:"path_hash"` LookupHash string `json:"lookup_hash"` Attributes Attributes `json:"attributes"` Children []RefEntity `json:"-"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` // contains filtered or unexported fields }
func (*Ref) CalculateHash ¶
func (*Ref) GetAttributes ¶
func (r *Ref) GetAttributes() Attributes
func (*Ref) GetCreatedAt ¶
func (*Ref) GetLookupHash ¶
func (*Ref) GetNumBlocks ¶
func (*Ref) GetPathHash ¶
func (*Ref) GetUpdatedAt ¶
func (*Ref) RemoveChild ¶
type ReferencePath ¶
type ReferencePath struct { Meta map[string]interface{} `json:"meta_data"` List []*ReferencePath `json:"list,omitempty"` }
func (*ReferencePath) GetDirTree ¶
func (rp *ReferencePath) GetDirTree(allocationID string) (*Ref, error)
GetDirTree covert and build root Ref with children
func (*ReferencePath) GetRefFromObjectTree ¶
func (rp *ReferencePath) GetRefFromObjectTree(allocationID string) (RefEntity, error)
Click to show internal directories.
Click to hide internal directories.