Documentation ¶
Index ¶
- Constants
- Variables
- func NewRSCode(nData, nParity int) (modules.ErasureCoder, error)
- type Renter
- func (r *Renter) ActiveHosts() []modules.HostDBEntry
- func (r *Renter) AllHosts() []modules.HostDBEntry
- func (r *Renter) Close() error
- func (r *Renter) Contracts() []modules.RenterContract
- func (r *Renter) DeleteFile(nickname string) error
- func (r *Renter) Download(path, destination string) error
- func (r *Renter) DownloadQueue() []modules.DownloadInfo
- func (r *Renter) FileList() []modules.FileInfo
- func (r *Renter) FinancialMetrics() modules.RenterFinancialMetrics
- func (r *Renter) LoadSharedFiles(filename string) ([]string, error)
- func (r *Renter) LoadSharedFilesAscii(asciiSia string) ([]string, error)
- func (r *Renter) RenameFile(currentName, newName string) error
- func (r *Renter) SetSettings(s modules.RenterSettings) error
- func (r *Renter) Settings() modules.RenterSettings
- func (r *Renter) ShareFiles(nicknames []string, shareDest string) error
- func (r *Renter) ShareFilesAscii(nicknames []string) (string, error)
- func (r *Renter) Upload(up modules.FileUploadParams) error
Constants ¶
const ( PersistFilename = "renter.json" )
Variables ¶
Functions ¶
Types ¶
type Renter ¶
type Renter struct {
// contains filtered or unexported fields
}
A Renter is responsible for tracking all of the files that a user has uploaded to Sia, as well as the locations and health of these files.
func New ¶
func New(cs modules.ConsensusSet, wallet modules.Wallet, tpool modules.TransactionPool, persistDir string) (*Renter, error)
New returns an initialized renter.
func (*Renter) ActiveHosts ¶
func (r *Renter) ActiveHosts() []modules.HostDBEntry
hostdb passthroughs
func (*Renter) AllHosts ¶
func (r *Renter) AllHosts() []modules.HostDBEntry
func (*Renter) Contracts ¶
func (r *Renter) Contracts() []modules.RenterContract
contractor passthroughs
func (*Renter) DeleteFile ¶
DeleteFile removes a file entry from the renter and deletes its data from the hosts it is stored on.
func (*Renter) Download ¶
Download downloads a file, identified by its path, to the destination specified.
func (*Renter) DownloadQueue ¶
func (r *Renter) DownloadQueue() []modules.DownloadInfo
DownloadQueue returns the list of downloads in the queue.
func (*Renter) FinancialMetrics ¶
func (r *Renter) FinancialMetrics() modules.RenterFinancialMetrics
func (*Renter) LoadSharedFiles ¶
LoadSharedFiles loads a .sia file into the renter. It returns the nicknames of the loaded files.
func (*Renter) LoadSharedFilesAscii ¶
LoadSharedFilesAscii loads an ASCII-encoded .sia file into the renter. It returns the nicknames of the loaded files.
func (*Renter) RenameFile ¶
RenameFile takes an existing file and changes the nickname. The original file must exist, and there must not be any file that already has the replacement nickname.
func (*Renter) SetSettings ¶
func (r *Renter) SetSettings(s modules.RenterSettings) error
func (*Renter) Settings ¶
func (r *Renter) Settings() modules.RenterSettings
func (*Renter) ShareFiles ¶
ShareFile saves the specified files to shareDest.
func (*Renter) ShareFilesAscii ¶
ShareFilesAscii returns the specified files in ASCII format.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package contractor is responsible for forming and renewing file contracts with hosts.
|
Package contractor is responsible for forming and renewing file contracts with hosts. |
Package hostdb provides a HostDB object that implements the renter.hostDB interface.
|
Package hostdb provides a HostDB object that implements the renter.hostDB interface. |