Documentation ¶
Index ¶
- Constants
- Variables
- type Download
- type Renter
- func (r *Renter) DeleteFile(nickname string) error
- 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) LoadSharedFile(filename string) ([]string, error)
- func (r *Renter) LoadSharedFilesAscii(asciiSia string) ([]string, error)
- func (r *Renter) ReceiveConsensusSetUpdate(cc modules.ConsensusChange)
- func (r *Renter) RenameFile(currentName, newName string) error
- func (r *Renter) RenterNotify() <-chan struct{}
- 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 ( ErrUnknownNickname = errors.New("no file known by that nickname") ErrNicknameOverload = errors.New("a file with the proposed nickname already exists") )
var ( ErrNoNicknames = errors.New("at least one nickname must be supplied") )
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. It implements the modules.DownloadInfo interface.
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 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 *consensus.State, hdb modules.HostDB, wallet modules.Wallet, saveDir string) (*Renter, error)
New returns an empty renter.
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 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.
func (*Renter) LoadSharedFile ¶ added in v0.3.1
LoadSharedFile loads a shared file into the renter.
func (*Renter) LoadSharedFilesAscii ¶ added in v0.3.1
loadSharedFile takes an encoded set of files and adds them to the renter, taking them form an ascii string.
func (*Renter) ReceiveConsensusSetUpdate ¶ added in v0.3.1
func (r *Renter) ReceiveConsensusSetUpdate(cc modules.ConsensusChange)
ReceiveConsensusSetUpdate will be called by the consensus set every time there is a change in the blockchain. Updates will always be called in order.
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) RenterNotify ¶ added in v0.3.1
func (r *Renter) RenterNotify() <-chan struct{}
RenterNotify returns a channel that will be sent a struct{} every time there is an update received from another module.
func (*Renter) ShareFiles ¶ added in v0.3.1
ShareFiles saves a '.sia' file that can be shared with others, enabling them to download the file you are sharing. It creates a Sia equivalent of a '.torrent'.
func (*Renter) ShareFilesAscii ¶ added in v0.3.1
ShareFilesAscii returns an ascii string that can be shared with other daemons, granting them access to the files.