fileref

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 7 Imported by: 9

Documentation

Index

Constants

View Source
const (
	FILE      = "f"
	DIRECTORY = "d"
)
View Source
const CHUNK_SIZE = 64 * 1024

Variables

This section is empty.

Functions

func GetReferenceLookup

func GetReferenceLookup(allocationID string, path string) string

Types

type FileRef

type FileRef struct {
	Ref                 `json:",squash"`
	CustomMeta          string `json:"custom_meta"`
	ContentHash         string `json:"content_hash"`
	Size                int64  `json:"size"`
	MerkleRoot          string `json:"merkle_root"`
	ActualFileSize      int64  `json:"actual_file_size"`
	ActualFileHash      string `json:"actual_file_hash"`
	ActualThubnailSize  int64  `json:"actual_thumnail_size"`
	ActualThumbnailHash string `json:"actual_thumbnail_hash"`
	MimeType            string `json:"mimetype"`
}

func (*FileRef) CalculateHash

func (fr *FileRef) CalculateHash() string

func (*FileRef) GetHash

func (fr *FileRef) GetHash() string

func (*FileRef) GetHashData

func (fr *FileRef) GetHashData() string

func (*FileRef) GetLookupHash

func (fr *FileRef) GetLookupHash() string

func (*FileRef) GetName

func (fr *FileRef) GetName() string

func (*FileRef) GetNumBlocks

func (fr *FileRef) GetNumBlocks() int64

func (*FileRef) GetPath

func (fr *FileRef) GetPath() string

func (*FileRef) GetPathHash

func (fr *FileRef) GetPathHash() string

func (*FileRef) GetType

func (fr *FileRef) GetType() string

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"`
	Hash         string      `json:"hash"`
	NumBlocks    int64       `json:"num_of_blocks"`
	PathHash     string      `json:"path_hash"`
	LookupHash   string      `json:"lookup_hash"`
	Children     []RefEntity `json:"-"`
}

func (*Ref) AddChild

func (r *Ref) AddChild(child RefEntity)

func (*Ref) CalculateHash

func (r *Ref) CalculateHash() string

func (*Ref) GetHash

func (r *Ref) GetHash() string

func (*Ref) GetLookupHash

func (r *Ref) GetLookupHash() string

func (*Ref) GetName

func (r *Ref) GetName() string

func (*Ref) GetNumBlocks

func (r *Ref) GetNumBlocks() int64

func (*Ref) GetPath

func (r *Ref) GetPath() string

func (*Ref) GetPathHash

func (r *Ref) GetPathHash() string

func (*Ref) GetType

func (r *Ref) GetType() string

func (*Ref) RemoveChild

func (r *Ref) RemoveChild(idx int)

type RefEntity

type RefEntity interface {
	GetNumBlocks() int64
	GetHash() string
	CalculateHash() string
	GetType() string
	GetPathHash() string
	GetLookupHash() string
	GetPath() string
	GetName() string
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL