Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // AbsPath represents the actual path in the filesystem AbsPath string `json:"-"` // RelPath represents the relative path of the file in the backup structure RelPath string `json:"path"` // Hash is an hexadecimal representation of the hash of the file Hash string `json:"hash"` // Size represent the size of the file in bytes Size int64 `json:"size"` }
File is the gkup internal representation of a file. It is NOT guaranteed that all of any of its fields have data, so if you don't trust its source you should check for its zero value.
Also, if you implement this type, you should return the specified zero value in each file you left empty.
The zero values of each field are:
- AbsPath: ""
- RelPath: ""
- Hash: ""
- Size: Any value below 0 (0 itself excluded, it's a valid size)
func (*File) CheckAbsPath ¶ added in v0.3.0
CheckAbsPath returns ErrEmptyAbsPath if the AbsPath property of the object provided has a zero-value
func (*File) CheckHash ¶ added in v0.3.0
CheckHash returns ErrEmptyHash if the Hash property of the object provided has a zero-value
func (*File) CheckRelPath ¶ added in v0.3.0
CheckRelPath returns ErrEmptyRelPath if the RelPath property of the object provided has a zero-value
type SafeFileList ¶
type SafeFileList struct { List []*File // contains filtered or unexported fields }
SafeFileList represents a list of File safe for concurrent use.
func (*SafeFileList) Next ¶
func (sfl *SafeFileList) Next() *File
Next will return the next value, or nil if no more values are found.