Documentation ¶
Index ¶
- type Download
- type File
- type FilePiece
- type Renter
- func (r *Renter) Download(nickname, destination string) error
- func (r *Renter) DownloadQueue() []modules.DownloadInfo
- func (r *Renter) FileList() (files []modules.FileInfo)
- func (r *Renter) Info() (ri modules.RentInfo)
- func (r *Renter) Rename(currentName, newName string) error
- func (r *Renter) Upload(up modules.UploadParams) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Download ¶
type Download struct {
// contains filtered or unexported fields
}
A Download is a file download that has been queued by the renter.
func (*Download) Destination ¶
Destination returns the file's location on disk.
func (*Download) Nickname ¶
Nickname returns the identifier assigned to the file when it was uploaded.
type File ¶
type File struct {
// contains filtered or unexported fields
}
A file is a single file that has been uploaded to the network.
func (*File) TimeRemaining ¶
func (f *File) TimeRemaining() consensus.BlockHeight
TimeRemaining returns the amount of time until the file's contracts expire.
type FilePiece ¶
type FilePiece struct { Active bool // Set to true if the host is online and has the file, false otherwise. Repairing bool // Set to true if there's an upload happening for the piece at the moment. Contract consensus.FileContract // The contract being enforced. ContractID consensus.FileContractID // The ID of the contract. HostIP modules.NetAddress // Where to find the file. }
A FilePiece contains information about an individual file piece that has been uploaded to a host, including information about the host and the health of the file piece.
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(state *consensus.State, gateway modules.Gateway, hdb modules.HostDB, wallet modules.Wallet, saveDir string) (r *Renter, err error)
New returns an empty renter.
func (*Renter) Download ¶
Download downloads a file, identified by its nickname, to the destination specified.
func (*Renter) DownloadQueue ¶
func (r *Renter) DownloadQueue() []modules.DownloadInfo
DownloadQueue returns the list of downloads in the queue.
func (*Renter) Info ¶
Info returns generic information about the renter and the files that are being rented.