client

package
v0.0.0-...-c98baff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HostParamCollateralBudget is the collateral budget of the host in
	// hastings.
	HostParamCollateralBudget = HostParam("collateralbudget")
	// HostParamMaxCollateral is the max collateral of the host in hastings.
	HostParamMaxCollateral = HostParam("maxcollateral")
	// HostParamMinContractPrice is the min contract price in hastings.
	HostParamMinContractPrice = HostParam("mincontractprice")
	// HostParamMinDownloadBandwidthPrice is the min download bandwidth price
	// in hastings/byte.
	HostParamMinDownloadBandwidthPrice = HostParam("mindownloadbandwidthprice")
	// HostParamMinUploadBandwidthPrice is the min upload bandwidth price in
	// hastings/byte.
	HostParamMinUploadBandwidthPrice = HostParam("minuploadbandwidthprice")
	// HostParamCollateral is the host's collateral in hastings/byte/block.
	HostParamCollateral = HostParam("collateral")
	// HostParamMinBaseRPCPrice is the minimum base RPC price in hastings.
	HostParamMinBaseRPCPrice = HostParam("minbaserpcprice")
	// HostParamMinSectorAccessPrice is the minimum sector access price in
	// hastings.
	HostParamMinSectorAccessPrice = HostParam("minsectoraccessprice")
	// HostParamMinStoragePrice is the minimum storage price in
	// hastings/byte/block.
	HostParamMinStoragePrice = HostParam("minstorageprice")
	// HostParamAcceptingContracts indicates if the host is accepting new
	// contracts.
	HostParamAcceptingContracts = HostParam("acceptingcontracts")
	// HostParamMaxDuration is the max duration of a contract in blocks.
	HostParamMaxDuration = HostParam("maxduration")
	// HostParamWindowSize is the size of the proof window in blocks.
	HostParamWindowSize = HostParam("windowsize")
	// HostParamMaxDownloadBatchSize is the maximum size of the download batch
	// size in bytes.
	HostParamMaxDownloadBatchSize = HostParam("maxdownloadbatchsize")
	// HostParamMaxReviseBatchSize is the maximum size of the revise batch size.
	HostParamMaxReviseBatchSize = HostParam("maxrevisebatchsize")
	// HostParamNetAddress is the announced netaddress of the host.
	HostParamNetAddress = HostParam("netaddress")
	// HostParamEphemeralAccountExpiry is the maximum amount of time an
	// ephemeral account can be inactive before it expires and gets deleted.
	HostParamEphemeralAccountExpiry = HostParam("ephemeralaccountexpiry")
	// HostParamMaxEphemeralAccountBalance is the maximum ephemeral account
	// balance in hastings
	HostParamMaxEphemeralAccountBalance = HostParam("maxephemeralaccountbalance")
	// HostParamMaxEphemeralAccountRisk is the maximum ephemeral account risk in
	// hastings
	HostParamMaxEphemeralAccountRisk = HostParam("maxephemeralaccountrisk")
)

Variables

View Source
var (
	// ErrPeerExists indicates that two peers are already connected. The string
	// of this error needs to be updated if the string of errPeerExists in the
	// gateway package is changed.
	ErrPeerExists = errors.New("already connected to this peer")
)

Functions

This section is empty.

Types

type AllowanceRequestPost

type AllowanceRequestPost struct {
	// contains filtered or unexported fields
}

AllowanceRequestPost is a helper type to be able to build an allowance request.

func (*AllowanceRequestPost) Send

func (a *AllowanceRequestPost) Send() (err error)

Send finalizes and sends the request.

func (*AllowanceRequestPost) WithExpectedDownload

func (a *AllowanceRequestPost) WithExpectedDownload(expectedDownload uint64) *AllowanceRequestPost

WithExpectedDownload adds the expected download field to the request.

func (*AllowanceRequestPost) WithExpectedRedundancy

func (a *AllowanceRequestPost) WithExpectedRedundancy(expectedRedundancy float64) *AllowanceRequestPost

WithExpectedRedundancy adds the expected redundancy field to the request.

func (*AllowanceRequestPost) WithExpectedStorage

func (a *AllowanceRequestPost) WithExpectedStorage(expectedStorage uint64) *AllowanceRequestPost

WithExpectedStorage adds the expected storage field to the request.

func (*AllowanceRequestPost) WithExpectedUpload

func (a *AllowanceRequestPost) WithExpectedUpload(expectedUpload uint64) *AllowanceRequestPost

WithExpectedUpload adds the expected upload field to the request.

func (*AllowanceRequestPost) WithFunds

WithFunds adds the funds field to the request.

func (*AllowanceRequestPost) WithHosts

func (a *AllowanceRequestPost) WithHosts(hosts uint64) *AllowanceRequestPost

WithHosts adds the hosts field to the request.

func (*AllowanceRequestPost) WithMaxContractPrice

func (a *AllowanceRequestPost) WithMaxContractPrice(price types.Currency) *AllowanceRequestPost

WithMaxContractPrice adds the maxcontract field to the request.

func (*AllowanceRequestPost) WithMaxDownloadBandwidthPrice

func (a *AllowanceRequestPost) WithMaxDownloadBandwidthPrice(price types.Currency) *AllowanceRequestPost

WithMaxDownloadBandwidthPrice adds the maxdownloadbandwidthprice field to the request.

func (*AllowanceRequestPost) WithMaxPeriodChurn

func (a *AllowanceRequestPost) WithMaxPeriodChurn(maxPeriodChurn uint64) *AllowanceRequestPost

WithMaxPeriodChurn adds the expected redundancy field to the request.

func (*AllowanceRequestPost) WithMaxRPCPrice

func (a *AllowanceRequestPost) WithMaxRPCPrice(price types.Currency) *AllowanceRequestPost

WithMaxRPCPrice adds the maxrpcprice field to the request.

func (*AllowanceRequestPost) WithMaxSectorAccessPrice

func (a *AllowanceRequestPost) WithMaxSectorAccessPrice(price types.Currency) *AllowanceRequestPost

WithMaxSectorAccessPrice adds the maxsectoraccessprice field to the request.

func (*AllowanceRequestPost) WithMaxStoragePrice

func (a *AllowanceRequestPost) WithMaxStoragePrice(price types.Currency) *AllowanceRequestPost

WithMaxStoragePrice adds the maxstorageprice field to the request.

func (*AllowanceRequestPost) WithMaxUploadBandwidthPrice

func (a *AllowanceRequestPost) WithMaxUploadBandwidthPrice(price types.Currency) *AllowanceRequestPost

WithMaxUploadBandwidthPrice adds the maxuploadbandwidthprice field to the request.

func (*AllowanceRequestPost) WithPaymentContractInitialFunding

func (a *AllowanceRequestPost) WithPaymentContractInitialFunding(price types.Currency) *AllowanceRequestPost

WithPaymentContractInitialFunding adds the paymentcontractinitialfunding field to the request.

func (*AllowanceRequestPost) WithPeriod

WithPeriod adds the period field to the request.

func (*AllowanceRequestPost) WithRenewWindow

func (a *AllowanceRequestPost) WithRenewWindow(renewWindow types.BlockHeight) *AllowanceRequestPost

WithRenewWindow adds the renewwindow field to the request.

type Client

type Client struct {
	// Address is the API address of the i3vd server.
	Address string

	// Password must match the password of the i3vd server.
	Password string

	// UserAgent must match the User-Agent required by the i3vd server. If not
	// set, it defaults to "I3v-Agent".
	UserAgent string
}

A Client makes requests to the i3vd HTTP API.

func New

func New(address string) *Client

New creates a new Client using the provided address.

func (*Client) ConsensusBlocksHeightGet

func (c *Client) ConsensusBlocksHeightGet(height types.BlockHeight) (cbg api.ConsensusBlocksGet, err error)

ConsensusBlocksHeightGet requests the /consensus/blocks api resource

func (*Client) ConsensusBlocksIDGet

func (c *Client) ConsensusBlocksIDGet(id types.BlockID) (cbg api.ConsensusBlocksGet, err error)

ConsensusBlocksIDGet requests the /consensus/blocks api resource

func (*Client) ConsensusGet

func (c *Client) ConsensusGet() (cg api.ConsensusGET, err error)

ConsensusGet requests the /consensus api resource

func (*Client) DaemonAlertsGet

func (c *Client) DaemonAlertsGet() (dag api.DaemonAlertsGet, err error)

DaemonAlertsGet requests the /daemon/alerts resource.

func (*Client) DaemonGlobalRateLimitPost

func (c *Client) DaemonGlobalRateLimitPost(downloadSpeed, uploadSpeed int64) (err error)

DaemonGlobalRateLimitPost uses the /daemon/settings endpoint to change the i3vd's bandwidth rate limit. downloadSpeed and uploadSpeed are interpreted as bytes/second.

func (*Client) DaemonSettingsGet

func (c *Client) DaemonSettingsGet() (dsg api.DaemonSettingsGet, err error)

DaemonSettingsGet requests the /daemon/settings api resource.

func (*Client) DaemonStopGet

func (c *Client) DaemonStopGet() (err error)

DaemonStopGet stops the daemon using the /daemon/stop endpoint.

func (*Client) DaemonUpdateGet

func (c *Client) DaemonUpdateGet() (dig api.DaemonUpdateGet, err error)

DaemonUpdateGet checks for an available daemon update.

func (*Client) DaemonUpdatePost

func (c *Client) DaemonUpdatePost() (err error)

DaemonUpdatePost updates the daemon.

func (*Client) DaemonVersionGet

func (c *Client) DaemonVersionGet() (dvg api.DaemonVersionGet, err error)

DaemonVersionGet requests the /daemon/version resource.

func (*Client) GatewayAppendBlacklistPost

func (c *Client) GatewayAppendBlacklistPost(addresses []string) (err error)

GatewayAppendBlacklistPost uses the /gateway/blacklist endpoint to append addresses to the Gateway's blacklist

func (*Client) GatewayBandwidthGet

func (c *Client) GatewayBandwidthGet() (gbg api.GatewayBandwidthGET, err error)

GatewayBandwidthGet requests the /gateway/bandwidth api resource

func (*Client) GatewayBlacklistGet

func (c *Client) GatewayBlacklistGet() (gbg api.GatewayBlacklistGET, err error)

GatewayBlacklistGet uses the /gateway/blacklist endpoint to request the Gateway's blacklist

func (*Client) GatewayConnectPost

func (c *Client) GatewayConnectPost(address modules.NetAddress) (err error)

GatewayConnectPost uses the /gateway/connect/:address endpoint to connect to the gateway at address

func (*Client) GatewayDisconnectPost

func (c *Client) GatewayDisconnectPost(address modules.NetAddress) (err error)

GatewayDisconnectPost uses the /gateway/disconnect/:address endpoint to disconnect the gateway from a peer.

func (*Client) GatewayGet

func (c *Client) GatewayGet() (gwg api.GatewayGET, err error)

GatewayGet requests the /gateway api resource

func (*Client) GatewayRateLimitPost

func (c *Client) GatewayRateLimitPost(downloadSpeed, uploadSpeed int64) (err error)

GatewayRateLimitPost uses the /gateway endpoint to change the gateway's bandwidth rate limit. downloadSpeed and uploadSpeed are interpreted as bytes/second.

func (*Client) GatewayRemoveBlacklistPost

func (c *Client) GatewayRemoveBlacklistPost(addresses []string) (err error)

GatewayRemoveBlacklistPost uses the /gateway/blacklist endpoint to remove addresses from the Gateway's blacklist

func (*Client) GatewaySetBlacklistPost

func (c *Client) GatewaySetBlacklistPost(addresses []string) (err error)

GatewaySetBlacklistPost uses the /gateway/blacklist endpoint to set the Gateway's blacklist

func (*Client) HostAnnounceAddrPost

func (c *Client) HostAnnounceAddrPost(address modules.NetAddress) (err error)

HostAnnounceAddrPost uses the /host/anounce endpoint to announce the host to the network using the provided address.

func (*Client) HostAnnouncePost

func (c *Client) HostAnnouncePost() (err error)

HostAnnouncePost uses the /host/announce endpoint to announce the host to the network

func (*Client) HostBandwidthGet

func (c *Client) HostBandwidthGet() (gbg api.GatewayBandwidthGET, err error)

HostBandwidthGet requests the /host/bandwidth api resource

func (*Client) HostContractInfoGet

func (c *Client) HostContractInfoGet() (cg api.ContractInfoGET, err error)

HostContractInfoGet uses the /host/contracts endpoint to get information about contracts on the host.

func (*Client) HostDbActiveGet

func (c *Client) HostDbActiveGet() (hdag api.HostdbActiveGET, err error)

HostDbActiveGet requests the /hostdb/active endpoint's resources.

func (*Client) HostDbAllGet

func (c *Client) HostDbAllGet() (hdag api.HostdbAllGET, err error)

HostDbAllGet requests the /hostdb/all endpoint's resources.

func (*Client) HostDbFilterModeGet

func (c *Client) HostDbFilterModeGet() (hdfmg api.HostdbFilterModeGET, err error)

HostDbFilterModeGet requests the /hostdb/filtermode GET endpoint

func (*Client) HostDbFilterModePost

func (c *Client) HostDbFilterModePost(fm modules.FilterMode, hosts []types.I3vPublicKey) (err error)

HostDbFilterModePost requests the /hostdb/filtermode POST endpoint

func (*Client) HostDbGet

func (c *Client) HostDbGet() (hdg api.HostdbGet, err error)

HostDbGet requests the /hostdb endpoint's resources.

func (*Client) HostDbHostsGet

func (c *Client) HostDbHostsGet(pk types.I3vPublicKey) (hhg api.HostdbHostsGET, err error)

HostDbHostsGet request the /hostdb/hosts/:pubkey endpoint's resources.

func (*Client) HostEstimateScoreGet

func (c *Client) HostEstimateScoreGet(param, value string) (eg api.HostEstimateScoreGET, err error)

HostEstimateScoreGet requests the /host/estimatescore endpoint.

func (*Client) HostGet

func (c *Client) HostGet() (hg api.HostGET, err error)

HostGet requests the /host endpoint.

func (*Client) HostModifySettingPost

func (c *Client) HostModifySettingPost(param HostParam, value interface{}) (err error)

HostModifySettingPost uses the /host endpoint to change a param of the host settings to a certain value.

func (*Client) HostStorageFoldersAddPost

func (c *Client) HostStorageFoldersAddPost(path string, size uint64) (err error)

HostStorageFoldersAddPost uses the /host/storage/folders/add api endpoint to add a storage folder to a host

func (*Client) HostStorageFoldersRemovePost

func (c *Client) HostStorageFoldersRemovePost(path string, force bool) (err error)

HostStorageFoldersRemovePost uses the /host/storage/folders/remove api endpoint to remove a storage folder from a host.

func (*Client) HostStorageFoldersResizePost

func (c *Client) HostStorageFoldersResizePost(path string, size uint64) (err error)

HostStorageFoldersResizePost uses the /host/storage/folders/resize api endpoint to resize an existing storage folder.

func (*Client) HostStorageGet

func (c *Client) HostStorageGet() (sg api.StorageGET, err error)

HostStorageGet requests the /host/storage endpoint.

func (*Client) HostStorageSectorsDeletePost

func (c *Client) HostStorageSectorsDeletePost(root crypto.Hash) (err error)

HostStorageSectorsDeletePost uses the /host/storage/sectors/delete endpoint to delete a sector from the host.

func (*Client) MinerBlockPost

func (c *Client) MinerBlockPost(b types.Block) (err error)

MinerBlockPost uses the /miner/block endpoint to submit a solved block.

func (*Client) MinerGet

func (c *Client) MinerGet() (mg api.MinerGET, err error)

MinerGet requests the /miner endpoint's resources.

func (*Client) MinerHeaderGet

func (c *Client) MinerHeaderGet() (target types.Target, bh types.BlockHeader, err error)

MinerHeaderGet uses the /miner/header endpoint to get a header for work.

func (*Client) MinerHeaderPost

func (c *Client) MinerHeaderPost(bh types.BlockHeader) (err error)

MinerHeaderPost uses the /miner/header endpoint to submit a solved block header that was previously received from the same endpoint

func (*Client) MinerStartGet

func (c *Client) MinerStartGet() (err error)

MinerStartGet uses the /miner/start endpoint to start the cpu miner.

func (*Client) MinerStopGet

func (c *Client) MinerStopGet() (err error)

MinerStopGet uses the /miner/stop endpoint to stop the cpu miner.

func (*Client) NewRequest

func (c *Client) NewRequest(method, resource string, body io.Reader) (*http.Request, error)

NewRequest constructs a request to the i3vd HTTP API, setting the correct User-Agent and Basic Auth. The resource path must begin with /.

func (*Client) RenterAllContractsGet

func (c *Client) RenterAllContractsGet() (rc api.RenterContracts, err error)

RenterAllContractsGet requests the /renter/contracts resource with all options set to true

func (*Client) RenterAllowanceCancelPost

func (c *Client) RenterAllowanceCancelPost() (err error)

RenterAllowanceCancelPost uses the /renter/allowance/cancel endpoint to cancel the allowance.

func (*Client) RenterBackups

func (c *Client) RenterBackups() (ubs api.RenterBackupsGET, err error)

RenterBackups lists the backups the renter has uploaded to hosts.

func (*Client) RenterBackupsOnHost

func (c *Client) RenterBackupsOnHost(host types.I3vPublicKey) (ubs api.RenterBackupsGET, err error)

RenterBackupsOnHost lists the backups that the renter has uploaded to a specific host.

func (*Client) RenterCancelDownloadPost

func (c *Client) RenterCancelDownloadPost(id modules.DownloadID) (err error)

RenterCancelDownloadPost requests the /renter/download/cancel endpoint to cancel an ongoing doing.

func (*Client) RenterClearAllDownloadsPost

func (c *Client) RenterClearAllDownloadsPost() (err error)

RenterClearAllDownloadsPost requests the /renter/downloads/clear resource with no parameters

func (*Client) RenterClearDownloadsAfterPost

func (c *Client) RenterClearDownloadsAfterPost(after time.Time) (err error)

RenterClearDownloadsAfterPost requests the /renter/downloads/clear resource with only the after timestamp provided

func (*Client) RenterClearDownloadsBeforePost

func (c *Client) RenterClearDownloadsBeforePost(before time.Time) (err error)

RenterClearDownloadsBeforePost requests the /renter/downloads/clear resource with only the before timestamp provided

func (*Client) RenterClearDownloadsRangePost

func (c *Client) RenterClearDownloadsRangePost(after, before time.Time) (err error)

RenterClearDownloadsRangePost requests the /renter/downloads/clear resource with both before and after timestamps provided

func (*Client) RenterContractCancelPost

func (c *Client) RenterContractCancelPost(id types.FileContractID) (err error)

RenterContractCancelPost uses the /renter/contract/cancel endpoint to cancel a contract

func (*Client) RenterContractRecoveryProgressGet

func (c *Client) RenterContractRecoveryProgressGet() (rrs api.RenterRecoveryStatusGET, err error)

RenterContractRecoveryProgressGet returns information about potentially ongoing contract recovery scans.

func (*Client) RenterContractStatus

func (c *Client) RenterContractStatus(fcID types.FileContractID) (status modules.ContractWatchStatus, err error)

RenterContractStatus requests the /watchdog/contractstatus resource and returns the status of a contract.

func (*Client) RenterContractorChurnStatus

func (c *Client) RenterContractorChurnStatus() (churnStatus modules.ContractorChurnStatus, err error)

RenterContractorChurnStatus uses the /renter/contractorchurnstatus endpoint to get the current contractor churn status.

func (*Client) RenterContractsGet

func (c *Client) RenterContractsGet() (rc api.RenterContracts, err error)

RenterContractsGet requests the /renter/contracts resource and returns Contracts and ActiveContracts

func (*Client) RenterCreateBackupPost

func (c *Client) RenterCreateBackupPost(name string) (err error)

RenterCreateBackupPost creates a backup of the I3vFiles of the renter and uploads it to hosts.

func (*Client) RenterCreateLocalBackupPost deprecated

func (c *Client) RenterCreateLocalBackupPost(dst string) (err error)

RenterCreateLocalBackupPost creates a local backup of the I3vFiles of the renter.

Deprecated: Use RenterCreateBackupPost instead.

func (*Client) RenterDirCreatePost

func (c *Client) RenterDirCreatePost(i3vPath modules.I3vPath) (err error)

RenterDirCreatePost uses the /renter/dir/ endpoint to create a directory for the renter

func (*Client) RenterDirCreateWithModePost

func (c *Client) RenterDirCreateWithModePost(i3vPath modules.I3vPath, mode os.FileMode) (err error)

RenterDirCreateWithModePost uses the /renter/dir/ endpoint to create a directory for the renter with the specified permissions.

func (*Client) RenterDirDeletePost

func (c *Client) RenterDirDeletePost(i3vPath modules.I3vPath) (err error)

RenterDirDeletePost uses the /renter/dir/ endpoint to delete a directory for the renter

func (*Client) RenterDirDeleteRootPost

func (c *Client) RenterDirDeleteRootPost(i3vPath modules.I3vPath) (err error)

RenterDirDeleteRootPost uses the /renter/dir/ endpoint to delete a directory for the renter. It passes the `root=true` flag to indicate an absolute path.

func (*Client) RenterDirGet

func (c *Client) RenterDirGet(i3vPath modules.I3vPath) (rd api.RenterDirectory, err error)

RenterDirGet uses the /renter/dir/ endpoint to query a directory

func (*Client) RenterDirRenamePost

func (c *Client) RenterDirRenamePost(i3vPath, newI3vPath modules.I3vPath) (err error)

RenterDirRenamePost uses the /renter/dir/ endpoint to rename a directory for the renter

func (*Client) RenterDirRootGet

func (c *Client) RenterDirRootGet(i3vPath modules.I3vPath) (rd api.RenterDirectory, err error)

RenterDirRootGet uses the /renter/dir/ endpoint to query a directory, starting from the root path.

func (*Client) RenterDisabledContractsGet

func (c *Client) RenterDisabledContractsGet() (rc api.RenterContracts, err error)

RenterDisabledContractsGet requests the /renter/contracts resource with the disabled flag set to true

func (*Client) RenterDownloadFullGet

func (c *Client) RenterDownloadFullGet(i3vPath modules.I3vPath, destination string, async bool) (modules.DownloadID, error)

RenterDownloadFullGet uses the /renter/download endpoint to download a full file.

func (*Client) RenterDownloadGet

func (c *Client) RenterDownloadGet(i3vPath modules.I3vPath, destination string, offset, length uint64, async bool, disableLocalFetch bool) (modules.DownloadID, error)

RenterDownloadGet uses the /renter/download endpoint to download a file to a destination on disk.

func (*Client) RenterDownloadHTTPResponseGet

func (c *Client) RenterDownloadHTTPResponseGet(i3vPath modules.I3vPath, offset, length uint64, disableLocalFetch bool) (modules.DownloadID, []byte, error)

RenterDownloadHTTPResponseGet uses the /renter/download endpoint to download a file and return its data.

func (*Client) RenterDownloadInfoGet

func (c *Client) RenterDownloadInfoGet(uid modules.DownloadID) (di api.DownloadInfo, err error)

RenterDownloadInfoGet uses the /renter/downloadinfo endpoint to fetch information about a download from the history.

func (*Client) RenterDownloadsGet

func (c *Client) RenterDownloadsGet() (rdq api.RenterDownloadQueue, err error)

RenterDownloadsGet requests the /renter/downloads resource

func (*Client) RenterExpiredContractsGet

func (c *Client) RenterExpiredContractsGet() (rc api.RenterContracts, err error)

RenterExpiredContractsGet requests the /renter/contracts resource with the expired flag set to true

func (*Client) RenterFileDeletePost

func (c *Client) RenterFileDeletePost(i3vPath modules.I3vPath) (err error)

RenterFileDeletePost uses the /renter/delete endpoint to delete a file.

func (*Client) RenterFileDeleteRootPost

func (c *Client) RenterFileDeleteRootPost(i3vPath modules.I3vPath) (err error)

RenterFileDeleteRootPost uses the /renter/delete endpoint to delete a file. It passes the `root=true` flag to indicate an absolute path.

func (*Client) RenterFileGet

func (c *Client) RenterFileGet(i3vPath modules.I3vPath) (rf api.RenterFile, err error)

RenterFileGet uses the /renter/file/:i3vpath endpoint to query a file.

func (*Client) RenterFileRootGet

func (c *Client) RenterFileRootGet(i3vPath modules.I3vPath) (rf api.RenterFile, err error)

RenterFileRootGet uses the /renter/file/:i3vpath endpoint to query a file. It passes the `root=true` flag to indicate an absolute path.

func (*Client) RenterFilesGet

func (c *Client) RenterFilesGet(cached bool) (rf api.RenterFiles, err error)

RenterFilesGet requests the /renter/files resource.

func (*Client) RenterFuse

func (c *Client) RenterFuse() (fi api.RenterFuseInfo, err error)

RenterFuse uses the /renter/fuse endpoint to return information about the current fuse mount point.

func (*Client) RenterFuseMount

func (c *Client) RenterFuseMount(mount string, i3vPath modules.I3vPath, opts modules.MountOptions) (err error)

RenterFuseMount uses the /renter/fuse/mount endpoint to mount a fuse filesystem serving the provided i3vpath.

func (*Client) RenterFuseUnmount

func (c *Client) RenterFuseUnmount(mount string) (err error)

RenterFuseUnmount uses the /renter/fuse/unmount endpoint to unmount the currently-mounted fuse filesystem.

func (*Client) RenterGet

func (c *Client) RenterGet() (rg api.RenterGET, err error)

RenterGet requests the /renter resource.

func (*Client) RenterInactiveContractsGet

func (c *Client) RenterInactiveContractsGet() (rc api.RenterContracts, err error)

RenterInactiveContractsGet requests the /renter/contracts resource with the inactive flag set to true

func (*Client) RenterInitContractRecoveryScanPost

func (c *Client) RenterInitContractRecoveryScanPost() (err error)

RenterInitContractRecoveryScanPost initializes a contract recovery scan using the /renter/recoveryscan endpoint.

func (*Client) RenterPost

func (c *Client) RenterPost(values url.Values) (err error)

RenterPost uses the /renter POST endpoint to set fields of the renter. Values are encoded as a query string in the body

func (*Client) RenterPostAllowance

func (c *Client) RenterPostAllowance(allowance modules.Allowance) error

RenterPostAllowance uses the /renter endpoint to change the renter's allowance

func (*Client) RenterPostPartialAllowance

func (c *Client) RenterPostPartialAllowance() *AllowanceRequestPost

RenterPostPartialAllowance starts an allowance request which can be extended using its methods.

func (*Client) RenterPricesGet

func (c *Client) RenterPricesGet(allowance modules.Allowance) (rpg api.RenterPricesGET, err error)

RenterPricesGet requests the /renter/prices endpoint's resources.

func (*Client) RenterRateLimitPost

func (c *Client) RenterRateLimitPost(readBPS, writeBPS int64) (err error)

RenterRateLimitPost uses the /renter endpoint to change the renter's bandwidth rate limit.

func (*Client) RenterRecoverBackupPost

func (c *Client) RenterRecoverBackupPost(name string) (err error)

RenterRecoverBackupPost downloads and restores the specified backup.

func (*Client) RenterRecoverLocalBackupPost deprecated

func (c *Client) RenterRecoverLocalBackupPost(src string) (err error)

RenterRecoverLocalBackupPost restores the specified backup.

Deprecated: Use RenterCreateBackupPost instead.

func (*Client) RenterRecoverableContractsGet

func (c *Client) RenterRecoverableContractsGet() (rc api.RenterContracts, err error)

RenterRecoverableContractsGet requests the /renter/contracts resource with the recoverable flag set to true

func (*Client) RenterRenamePost

func (c *Client) RenterRenamePost(i3vPathOld, i3vPathNew modules.I3vPath) (err error)

RenterRenamePost uses the /renter/rename/:i3vpath endpoint to rename a file.

func (*Client) RenterSetCheckIPViolationPost

func (c *Client) RenterSetCheckIPViolationPost(enabled bool) (err error)

RenterSetCheckIPViolationPost uses the /renter endpoint to enable/disable the IP violation check in the renter.

func (*Client) RenterSetFileStuckPost

func (c *Client) RenterSetFileStuckPost(i3vPath modules.I3vPath, stuck bool) (err error)

RenterSetFileStuckPost sets the 'stuck' field of the i3vfile at i3vPath to stuck.

func (*Client) RenterSetRepairPathPost

func (c *Client) RenterSetRepairPathPost(i3vPath modules.I3vPath, newPath string) (err error)

RenterSetRepairPathPost uses the /renter/tracking endpoint to set the repair path of a file to a new location. The file at newPath must exists.

func (*Client) RenterSetStreamCacheSizePost

func (c *Client) RenterSetStreamCacheSizePost(cacheSize uint64) (err error)

RenterSetStreamCacheSizePost uses the /renter endpoint to change the renter's streamCacheSize for streaming

func (*Client) RenterStreamGet

func (c *Client) RenterStreamGet(i3vPath modules.I3vPath, disableLocalFetch bool) (resp []byte, err error)

RenterStreamGet uses the /renter/stream endpoint to download data as a stream.

func (*Client) RenterStreamPartialGet

func (c *Client) RenterStreamPartialGet(i3vPath modules.I3vPath, start, end uint64, disableLocalFetch bool) (resp []byte, err error)

RenterStreamPartialGet uses the /renter/stream endpoint to download a part of data as a stream.

func (*Client) RenterUploadDefaultPost

func (c *Client) RenterUploadDefaultPost(path string, i3vPath modules.I3vPath) (err error)

RenterUploadDefaultPost uses the /renter/upload endpoint with default redundancy settings to upload a file.

func (*Client) RenterUploadForcePost

func (c *Client) RenterUploadForcePost(path string, i3vPath modules.I3vPath, dataPieces, parityPieces uint64, force bool) (err error)

RenterUploadForcePost uses the /renter/upload endpoint to upload a file and to overwrite if the file already exists

func (*Client) RenterUploadPost

func (c *Client) RenterUploadPost(path string, i3vPath modules.I3vPath, dataPieces, parityPieces uint64) (err error)

RenterUploadPost uses the /renter/upload endpoint to upload a file

func (*Client) RenterUploadReadyDefaultGet

func (c *Client) RenterUploadReadyDefaultGet() (rur api.RenterUploadReadyGet, err error)

RenterUploadReadyDefaultGet uses the /renter/uploadready endpoint to determine if the renter is ready for upload.

func (*Client) RenterUploadReadyGet

func (c *Client) RenterUploadReadyGet(dataPieces, parityPieces uint64) (rur api.RenterUploadReadyGet, err error)

RenterUploadReadyGet uses the /renter/uploadready endpoint to determine if the renter is ready for upload.

func (*Client) RenterUploadStreamPost

func (c *Client) RenterUploadStreamPost(r io.Reader, i3vPath modules.I3vPath, dataPieces, parityPieces uint64, force bool) error

RenterUploadStreamPost uploads data using a stream.

func (*Client) RenterUploadStreamRepairPost

func (c *Client) RenterUploadStreamRepairPost(r io.Reader, i3vPath modules.I3vPath) error

RenterUploadStreamRepairPost a i3vfile using a stream. If the data provided by r is not the same as the previously uploaded data, the data will be corrupted.

func (*Client) RenterUploadsPausePost

func (c *Client) RenterUploadsPausePost(duration time.Duration) (err error)

RenterUploadsPausePost uses the /renter/uploads/pause endpoint to pause the renter's uploads and repairs

func (*Client) RenterUploadsResumePost

func (c *Client) RenterUploadsResumePost() (err error)

RenterUploadsResumePost uses the /renter/uploads/resume endpoint to resume the renter's uploads and repairs

func (*Client) RenterValidateI3vPathPost

func (c *Client) RenterValidateI3vPathPost(i3vPathStr string) (err error)

RenterValidateI3vPathPost uses the /renter/validatei3vpath endpoint to validate a potential i3vpath

NOTE: This function specifically takes a string as an argument not a type I3vPath

func (*Client) SkynetBlacklistGet

func (c *Client) SkynetBlacklistGet() (blacklist api.SkynetBlacklistGET, err error)

SkynetBlacklistGet requests the /skynet/blacklist Get endpoint

func (*Client) SkynetBlacklistPost

func (c *Client) SkynetBlacklistPost(additions, removals []string) (err error)

SkynetBlacklistPost requests the /skynet/blacklist Post endpoint

func (*Client) SkynetConvertI3vfileToSkyfilePost

func (c *Client) SkynetConvertI3vfileToSkyfilePost(lup modules.SkyfileUploadParameters, convert modules.I3vPath) (string, error)

SkynetConvertI3vfileToSkyfilePost uses the /skynet/skyfile endpoint to convert an existing i3vfile to a skyfile. The input I3vPath 'convert' is the i3vpath of the i3vfile that should be converted. The i3vpath provided inside of the upload params is the name that will be used for the base sector of the skyfile.

func (*Client) SkynetSkyfileMultiPartPost

func (c *Client) SkynetSkyfileMultiPartPost(params modules.SkyfileMultipartUploadParameters) (string, api.SkynetSkyfileHandlerPOST, error)

SkynetSkyfileMultiPartPost uses the /skynet/skyfile endpoint to upload a skyfile using multipart form data. The resulting skylink is returned along with an error.

func (*Client) SkynetSkyfilePost

SkynetSkyfilePost uses the /skynet/skyfile endpoint to upload a skyfile. The resulting skylink is returned along with an error.

func (*Client) SkynetSkylinkGet

func (c *Client) SkynetSkylinkGet(skylink string) ([]byte, modules.SkyfileMetadata, error)

SkynetSkylinkGet uses the /skynet/skylink endpoint to download a skylink file.

func (*Client) SkynetSkylinkPinPost

func (c *Client) SkynetSkylinkPinPost(skylink string, params modules.SkyfilePinParameters) error

SkynetSkylinkPinPost uses the /skynet/pin endpoint to pin the file at the given skylink.

func (*Client) SkynetSkylinkReaderGet

func (c *Client) SkynetSkylinkReaderGet(skylink string) (io.ReadCloser, error)

SkynetSkylinkReaderGet uses the /skynet/skylink endpoint to fetch a reader of the file data.

func (*Client) TransactionPoolFeeGet

func (c *Client) TransactionPoolFeeGet() (tfg api.TpoolFeeGET, err error)

TransactionPoolFeeGet uses the /tpool/fee endpoint to get a fee estimation.

func (*Client) TransactionPoolRawPost

func (c *Client) TransactionPoolRawPost(txn types.Transaction, parents []types.Transaction) (err error)

TransactionPoolRawPost uses the /tpool/raw endpoint to send a raw transaction to the transaction pool.

func (*Client) TransactionPoolTransactionsGet

func (c *Client) TransactionPoolTransactionsGet() (tptg api.TpoolTxnsGET, err error)

TransactionPoolTransactionsGet uses the /tpool/transactions endpoint to get the transactions of the tpool

func (*Client) Wallet033xPost

func (c *Client) Wallet033xPost(path, password string) (err error)

Wallet033xPost uses the /wallet/033x endpoint to load a v0.3.3.x wallet into the current wallet.

func (*Client) WalletAddressGet

func (c *Client) WalletAddressGet() (wag api.WalletAddressGET, err error)

WalletAddressGet requests a new address from the /wallet/address endpoint

func (*Client) WalletAddressesGet

func (c *Client) WalletAddressesGet() (wag api.WalletAddressesGET, err error)

WalletAddressesGet requests the wallets known addresses from the /wallet/addresses endpoint.

func (*Client) WalletChangePasswordPost

func (c *Client) WalletChangePasswordPost(currentPassword, newPassword string) (err error)

WalletChangePasswordPost uses the /wallet/changepassword endpoint to change the wallet's password.

func (*Client) WalletChangePasswordWithSeedPost

func (c *Client) WalletChangePasswordWithSeedPost(seed modules.Seed, newPassword string) (err error)

WalletChangePasswordWithSeedPost uses the /wallet/changepassword endpoint to change the password used to encrypt the wallet.

func (*Client) WalletGet

func (c *Client) WalletGet() (wg api.WalletGET, err error)

WalletGet requests the /wallet api resource

func (*Client) WalletI3vcoinsMultiPost

func (c *Client) WalletI3vcoinsMultiPost(outputs []types.I3vcoinOutput) (wsp api.WalletI3vcoinsPOST, err error)

WalletI3vcoinsMultiPost uses the /wallet/i3vcoin api endpoint to send money to multiple addresses at once

func (*Client) WalletI3vcoinsPost

func (c *Client) WalletI3vcoinsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletI3vcoinsPOST, err error)

WalletI3vcoinsPost uses the /wallet/i3vcoins api endpoint to send money to a single address

func (*Client) WalletI3vfundsPost

func (c *Client) WalletI3vfundsPost(amount types.Currency, destination types.UnlockHash) (wsp api.WalletI3vfundsPOST, err error)

WalletI3vfundsPost uses the /wallet/i3vfunds api endpoint to send i3vfunds to a single address.

func (*Client) WalletI3vgKeyPost

func (c *Client) WalletI3vgKeyPost(keyfiles, password string) (err error)

WalletI3vgKeyPost uses the /wallet/i3vgkey endpoint to load a i3vg key into the wallet.

func (*Client) WalletInitPost

func (c *Client) WalletInitPost(password string, force bool) (wip api.WalletInitPOST, err error)

WalletInitPost uses the /wallet/init endpoint to initialize and encrypt a wallet

func (*Client) WalletInitSeedPost

func (c *Client) WalletInitSeedPost(seed, password string, force bool) (err error)

WalletInitSeedPost uses the /wallet/init/seed endpoint to initialize and encrypt a wallet using a given seed.

func (*Client) WalletLastAddressesGet

func (c *Client) WalletLastAddressesGet(count uint64) (wag api.WalletAddressesGET, err error)

WalletLastAddressesGet returns the count last addresses generated by the wallet in reverse order. That means the last generated address will be the first one in the slice.

func (*Client) WalletLockPost

func (c *Client) WalletLockPost() (err error)

WalletLockPost uses the /wallet/lock endpoint to lock the wallet.

func (*Client) WalletSeedPost

func (c *Client) WalletSeedPost(seed, password string) (err error)

WalletSeedPost uses the /wallet/seed endpoint to add a seed to the wallet's list of seeds.

func (*Client) WalletSeedsGet

func (c *Client) WalletSeedsGet() (wsg api.WalletSeedsGET, err error)

WalletSeedsGet uses the /wallet/seeds endpoint to return the wallet's current seeds.

func (*Client) WalletSignPost

func (c *Client) WalletSignPost(txn types.Transaction, toSign []crypto.Hash) (wspr api.WalletSignPOSTResp, err error)

WalletSignPost uses the /wallet/sign api endpoint to sign a transaction.

func (*Client) WalletSweepPost

func (c *Client) WalletSweepPost(seed string) (wsp api.WalletSweepPOST, err error)

WalletSweepPost uses the /wallet/sweep/seed endpoint to sweep a seed into the current wallet.

func (*Client) WalletTransactionGet

func (c *Client) WalletTransactionGet(id types.TransactionID) (wtg api.WalletTransactionGETid, err error)

WalletTransactionGet requests the /wallet/transaction/:id api resource for a certain TransactionID.

func (*Client) WalletTransactionsGet

func (c *Client) WalletTransactionsGet(startHeight types.BlockHeight, endHeight types.BlockHeight) (wtg api.WalletTransactionsGET, err error)

WalletTransactionsGet requests the/wallet/transactions api resource for a certain startheight and endheight

func (*Client) WalletUnlockConditionsGet

func (c *Client) WalletUnlockConditionsGet(addr types.UnlockHash) (wucg api.WalletUnlockConditionsGET, err error)

WalletUnlockConditionsGet requests the /wallet/unlockconditions endpoint and returns the UnlockConditions of addr.

func (*Client) WalletUnlockPost

func (c *Client) WalletUnlockPost(password string) (err error)

WalletUnlockPost uses the /wallet/unlock endpoint to unlock the wallet with a given encryption key. Per default this key is the seed.

func (*Client) WalletUnspentGet

func (c *Client) WalletUnspentGet() (wug api.WalletUnspentGET, err error)

WalletUnspentGet requests the /wallet/unspent endpoint and returns all of the unspent outputs related to the wallet.

func (*Client) WalletVerifyPasswordGet

func (c *Client) WalletVerifyPasswordGet(password string) (wvpg api.WalletVerifyPasswordGET, err error)

WalletVerifyPasswordGet uses the /wallet/verifypassword endpoint to check the wallet's password.

func (*Client) WalletWatchAddPost

func (c *Client) WalletWatchAddPost(addrs []types.UnlockHash, unused bool) error

WalletWatchAddPost uses the /wallet/watch endpoint to add a set of addresses to the watch set. The unused flag should be set to true if the addresses have never appeared in the blockchain.

func (*Client) WalletWatchGet

func (c *Client) WalletWatchGet() (wwg api.WalletWatchGET, err error)

WalletWatchGet requests the /wallet/watch endpoint and returns the set of currently watched addresses.

func (*Client) WalletWatchRemovePost

func (c *Client) WalletWatchRemovePost(addrs []types.UnlockHash, unused bool) error

WalletWatchRemovePost uses the /wallet/watch endpoint to remove a set of addresses from the watch set. The unused flag should be set to true if the addresses have never appeared in the blockchain.

type HostParam

type HostParam string

HostParam is a parameter in the host's settings that can be changed via the API. It is primarily used as a helper struct to ensure type safety.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL