Documentation ¶
Index ¶
- Constants
- Variables
- func NewRSCode(nData, nParity int) (modules.ErasureCoder, error)
- type Renter
- func (r *Renter) ActiveHosts() []modules.HostSettings
- func (r *Renter) AllHosts() []modules.HostSettings
- 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) LoadSharedFiles(filename string) ([]string, error)
- func (r *Renter) LoadSharedFilesAscii(asciiSia string) ([]string, error)
- func (r *Renter) RenameFile(currentName, newName string) error
- 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 ¶
var ( ErrUnknownPath = errors.New("no file known with that path") ErrPathOverload = errors.New("a file already exists at that location") )
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 empty renter.
func (*Renter) ActiveHosts ¶ added in v1.0.0
func (r *Renter) ActiveHosts() []modules.HostSettings
hostdb passthroughs
func (*Renter) AllHosts ¶ added in v1.0.0
func (r *Renter) AllHosts() []modules.HostSettings
func (*Renter) DeleteFile ¶ added in v0.3.1
DeleteFile removes a file entry from the renter.
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) LoadSharedFiles ¶ added in v1.0.0
LoadSharedFiles loads a .sia file into the renter. It returns the nicknames of the loaded files.
func (*Renter) LoadSharedFilesAscii ¶ added in v0.3.1
LoadSharedFilesAscii loads an ASCII-encoded .sia file into the renter. It returns the nicknames of the loaded files.
func (*Renter) RenameFile ¶ added in v0.3.1
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) ShareFiles ¶ added in v0.3.1
ShareFile saves the specified files to shareDest.
func (*Renter) ShareFilesAscii ¶ added in v0.3.1
ShareFilesAscii returns the specified files in ASCII format.