Versions in this module Expand all Collapse all v1 v1.4.0 Jun 23, 2019 Changes in this version + var ErrPathOverload = errors.New("a file already exists at that location") + var ErrUnknownPath = errors.New("no file known with that path") + var ErrUnknownThread = errors.New("thread should not be calling Close(), does not have control of the siafile") + var RemoteRepairDownloadThreshold = ... + func ApplyUpdates(updates ...writeaheadlog.Update) error + func ExtractSegment(pieces [][]byte, segmentIndex int, segmentSize uint64) [][]byte + func IsSiaFileUpdate(update writeaheadlog.Update) bool + func NewRSCode(nData, nParity int) (modules.ErasureCoder, error) + func NewRSSubCode(nData, nParity int, segmentSize uint64) (modules.ErasureCoder, error) + type BubbledMetadata struct + Health float64 + LastHealthCheckTime time.Time + ModTime time.Time + NumStuckChunks uint64 + RecentRepairTime time.Time + Redundancy float64 + Size uint64 + StuckHealth float64 + type CachedHealthMetadata struct + Health float64 + Redundancy float64 + StuckHealth float64 + type Chunk struct + Pieces [][]Piece + type FileChunk struct + Pieces [][]Piece + type FileData struct + Chunks []FileChunk + Deleted bool + ErasureCode modules.ErasureCoder + FileSize uint64 + MasterKey [crypto.EntropySize]byte + Mode os.FileMode + Name string + PieceSize uint64 + RepairPath string + UID string + type HostPublicKey struct + PublicKey types.SiaPublicKey + Used bool + func (hpk *HostPublicKey) UnmarshalSia(r io.Reader) error + func (hpk HostPublicKey) MarshalSia(w io.Writer) error + type Piece struct + HostPubKey types.SiaPublicKey + MerkleRoot crypto.Hash + type RSCode struct + func (rs *RSCode) Encode(data []byte) ([][]byte, error) + func (rs *RSCode) EncodeShards(pieces [][]byte) ([][]byte, error) + func (rs *RSCode) MinPieces() int + func (rs *RSCode) NumPieces() int + func (rs *RSCode) Recover(pieces [][]byte, n uint64, w io.Writer) error + func (rs *RSCode) SupportsPartialEncoding() bool + func (rs *RSCode) Type() modules.ErasureCoderType + type RSSubCode struct + func (rs *RSSubCode) Encode(data []byte) ([][]byte, error) + func (rs *RSSubCode) EncodeShards(pieces [][]byte) ([][]byte, error) + func (rs *RSSubCode) Recover(pieces [][]byte, n uint64, w io.Writer) error + func (rs *RSSubCode) SupportsPartialEncoding() bool + func (rs *RSSubCode) Type() modules.ErasureCoderType + type SiaFile struct + func LoadSiaFile(path string, wal *writeaheadlog.WAL) (*SiaFile, error) + func New(siaPath modules.SiaPath, siaFilePath, source string, wal *writeaheadlog.WAL, ...) (*SiaFile, error) + func (sf *SiaFile) AccessTime() time.Time + func (sf *SiaFile) AddPiece(pk types.SiaPublicKey, chunkIndex, pieceIndex uint64, merkleRoot crypto.Hash) error + func (sf *SiaFile) ChangeTime() time.Time + func (sf *SiaFile) ChunkHealth(index int, offlineMap map[string]bool, goodForRenewMap map[string]bool) float64 + func (sf *SiaFile) ChunkIndexByOffset(offset uint64) (chunkIndex uint64, off uint64) + func (sf *SiaFile) ChunkSize() uint64 + func (sf *SiaFile) CreateTime() time.Time + func (sf *SiaFile) Delete() error + func (sf *SiaFile) Deleted() bool + func (sf *SiaFile) ErasureCode() modules.ErasureCoder + func (sf *SiaFile) Expiration(contracts map[string]modules.RenterContract) types.BlockHeight + func (sf *SiaFile) Health(offline map[string]bool, goodForRenew map[string]bool) (float64, float64, uint64) + func (sf *SiaFile) HealthPercentage(health float64) float64 + func (sf *SiaFile) HostPublicKeys() (spks []types.SiaPublicKey) + func (sf *SiaFile) LastHealthCheckTime() time.Time + func (sf *SiaFile) LocalPath() string + func (sf *SiaFile) MarkAllHealthyChunksAsUnstuck(offline map[string]bool, goodForRenew map[string]bool) (err error) + func (sf *SiaFile) MarkAllUnhealthyChunksAsStuck(offline map[string]bool, goodForRenew map[string]bool) (err error) + func (sf *SiaFile) MasterKey() crypto.CipherKey + func (sf *SiaFile) ModTime() time.Time + func (sf *SiaFile) Mode() os.FileMode + func (sf *SiaFile) NumChunks() uint64 + func (sf *SiaFile) NumStuckChunks() uint64 + func (sf *SiaFile) PieceSize() uint64 + func (sf *SiaFile) Pieces(chunkIndex uint64) ([][]Piece, error) + func (sf *SiaFile) RecentRepairTime() time.Time + func (sf *SiaFile) Redundancy(offlineMap map[string]bool, goodForRenewMap map[string]bool) float64 + func (sf *SiaFile) Rename(newSiaPath modules.SiaPath, newSiaFilePath string) error + func (sf *SiaFile) SetLocalPath(path string) error + func (sf *SiaFile) SetMode(mode os.FileMode) error + func (sf *SiaFile) SetStuck(index uint64, stuck bool) (err error) + func (sf *SiaFile) SiaPath() modules.SiaPath + func (sf *SiaFile) Size() uint64 + func (sf *SiaFile) Snapshot() *Snapshot + func (sf *SiaFile) SnapshotReader() (*SnapshotReader, error) + func (sf *SiaFile) StuckChunkByIndex(index uint64) bool + func (sf *SiaFile) UID() string + func (sf *SiaFile) UpdateAccessTime() error + func (sf *SiaFile) UpdateCachedHealthMetadata(metadata CachedHealthMetadata) error + func (sf *SiaFile) UpdateLastHealthCheckTime() error + func (sf *SiaFile) UpdateRecentRepairTime() error + func (sf *SiaFile) UpdateUsedHosts(used []types.SiaPublicKey) error + func (sf *SiaFile) UploadProgress() float64 + func (sf *SiaFile) UploadedBytes() uint64 + type SiaFileSet struct + func NewSiaFileSet(filesDir string, wal *writeaheadlog.WAL) *SiaFileSet + func (sfs *SiaFileSet) Delete(siaPath modules.SiaPath) error + func (sfs *SiaFileSet) Exists(siaPath modules.SiaPath) bool + func (sfs *SiaFileSet) NewFromLegacyData(fd FileData) (*SiaFileSetEntry, error) + func (sfs *SiaFileSet) NewSiaFile(up modules.FileUploadParams, masterKey crypto.CipherKey, fileSize uint64, ...) (*SiaFileSetEntry, error) + func (sfs *SiaFileSet) Open(siaPath modules.SiaPath) (*SiaFileSetEntry, error) + func (sfs *SiaFileSet) Rename(siaPath, newSiaPath modules.SiaPath) error + type SiaFileSetEntry struct + func (entry *SiaFileSetEntry) Close() error + func (entry *SiaFileSetEntry) CopyEntry() *SiaFileSetEntry + type Snapshot struct + func (s *Snapshot) ChunkIndexByOffset(offset uint64) (chunkIndex uint64, off uint64) + func (s *Snapshot) ChunkSize() uint64 + func (s *Snapshot) ErasureCode() modules.ErasureCoder + func (s *Snapshot) MasterKey() crypto.CipherKey + func (s *Snapshot) Mode() os.FileMode + func (s *Snapshot) NumChunks() uint64 + func (s *Snapshot) PieceSize() uint64 + func (s *Snapshot) Pieces(chunkIndex uint64) ([][]Piece, error) + func (s *Snapshot) SiaPath() modules.SiaPath + func (s *Snapshot) Size() uint64 + type SnapshotReader struct + func (sfr *SnapshotReader) Close() error + func (sfr *SnapshotReader) Read(b []byte) (int, error) + func (sfr *SnapshotReader) Stat() (os.FileInfo, error)