Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Db represents a connection to leveldb Db *leveldb.DB )
Functions ¶
Types ¶
type Source ¶
type Source struct { // Src represents the ipfs hash of the file. Src string `json:"src"` // Size represents the size of the file. Size int64 `json:"size"` // Checksum represents the md5 checksum hash of file. Checksum string `json:"checksum"` }
Source represents the meta data of a file stored locally.
func NewSource ¶
NewSource generates a new source instance from a given path and validates the path, computes the file checksum and size.
type Sources ¶
Sources represents the store of the locally saved files.
func GetSources ¶
GetSources iterates through db, populate and return Sources.
func (Sources) ExtractSource ¶
ExtractSource look for and return a copy of Source and deletes the key from the mapping.
Click to show internal directories.
Click to hide internal directories.