Documentation
¶
Index ¶
- type Client
- func (c *Client) AbortMultipartUpload(ctx context.Context, bucket, path string, uploadID string) (err error)
- func (c *Client) AcceptBlock(ctx context.Context, b types.Block) (err error)
- func (c *Client) Accounts(ctx context.Context, owner string) (accounts []api.Account, err error)
- func (c *Client) AcquireContract(ctx context.Context, contractID types.FileContractID, priority int, ...) (lockID uint64, err error)
- func (c *Client) AddContract(ctx context.Context, contract rhpv2.ContractRevision, ...) (added api.ContractMetadata, err error)
- func (c *Client) AddMultipartPart(ctx context.Context, bucket, path, contractSet, eTag, uploadID string, ...) (err error)
- func (c *Client) AddObject(ctx context.Context, bucket, path, contractSet string, o object.Object, ...) (err error)
- func (c *Client) AddPartialSlab(ctx context.Context, data []byte, minShards, totalShards uint8, ...) (slabs []object.SlabSlice, slabBufferMaxSizeSoftReached bool, err error)
- func (c *Client) AddRenewedContract(ctx context.Context, contract rhpv2.ContractRevision, ...) (renewed api.ContractMetadata, err error)
- func (c *Client) AddUploadingSector(ctx context.Context, uID api.UploadID, id types.FileContractID, ...) (err error)
- func (c *Client) Alerts(ctx context.Context, opts alerts.AlertsOpts) (resp alerts.AlertsResponse, err error)
- func (c *Client) AncestorContracts(ctx context.Context, contractID types.FileContractID, minStartHeight uint64) (contracts []api.ArchivedContract, err error)
- func (c *Client) ArchiveContracts(ctx context.Context, toArchive map[types.FileContractID]string) (err error)
- func (c *Client) Autopilot(ctx context.Context, id string) (autopilot api.Autopilot, err error)
- func (c *Client) Autopilots(ctx context.Context) (autopilots []api.Autopilot, err error)
- func (c *Client) BroadcastAction(ctx context.Context, action webhooks.Event) error
- func (c *Client) BroadcastContract(ctx context.Context, contractID types.FileContractID) (txnID types.TransactionID, err error)
- func (c *Client) BroadcastTransaction(ctx context.Context, txns []types.Transaction) error
- func (c *Client) Bucket(ctx context.Context, bucketName string) (resp api.Bucket, err error)
- func (c *Client) CompleteMultipartUpload(ctx context.Context, bucket, path, uploadID string, ...) (resp api.MultipartCompleteResponse, err error)
- func (c *Client) ConsensusNetwork(ctx context.Context) (resp api.ConsensusNetwork, err error)
- func (c *Client) ConsensusState(ctx context.Context) (resp api.ConsensusState, err error)
- func (c *Client) Contract(ctx context.Context, id types.FileContractID) (contract api.ContractMetadata, err error)
- func (c *Client) ContractMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, ...) ([]api.ContractMetric, error)
- func (c *Client) ContractPruneMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, ...) ([]api.ContractPruneMetric, error)
- func (c *Client) ContractRoots(ctx context.Context, contractID types.FileContractID) (roots, uploading []types.Hash256, err error)
- func (c *Client) ContractSetChurnMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, ...) ([]api.ContractSetChurnMetric, error)
- func (c *Client) ContractSetMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, ...) ([]api.ContractSetMetric, error)
- func (c *Client) ContractSetSettings(ctx context.Context) (gs api.ContractSetSetting, err error)
- func (c *Client) ContractSets(ctx context.Context) (sets []string, err error)
- func (c *Client) ContractSize(ctx context.Context, contractID types.FileContractID) (size api.ContractSize, err error)
- func (c *Client) Contracts(ctx context.Context, opts api.ContractsOpts) (contracts []api.ContractMetadata, err error)
- func (c *Client) CopyObject(ctx context.Context, srcBucket, dstBucket, srcPath, dstPath string, ...) (om api.ObjectMetadata, err error)
- func (c *Client) CreateBucket(ctx context.Context, bucketName string, opts api.CreateBucketOptions) error
- func (c *Client) CreateMultipartUpload(ctx context.Context, bucket, path string, opts api.CreateMultipartOptions) (resp api.MultipartCreateResponse, err error)
- func (c *Client) DeleteAllContracts(ctx context.Context) (err error)
- func (c *Client) DeleteBucket(ctx context.Context, bucketName string) error
- func (c *Client) DeleteContract(ctx context.Context, id types.FileContractID) (err error)
- func (c *Client) DeleteContractSet(ctx context.Context, set string) (err error)
- func (c *Client) DeleteContracts(ctx context.Context, ids []types.FileContractID) error
- func (c *Client) DeleteHostSector(ctx context.Context, hostKey types.PublicKey, sectorRoot types.Hash256) error
- func (c *Client) DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)
- func (c *Client) DeleteSetting(ctx context.Context, key string) error
- func (c *Client) DismissAlerts(ctx context.Context, ids ...types.Hash256) error
- func (c *Client) FetchPartialSlab(ctx context.Context, key object.EncryptionKey, offset, length uint32) ([]byte, error)
- func (c *Client) FileContractTax(ctx context.Context, payout types.Currency) (tax types.Currency, err error)
- func (c *Client) FinishUpload(ctx context.Context, uID api.UploadID) (err error)
- func (c *Client) FormContract(ctx context.Context, renterAddress types.Address, renterFunds types.Currency, ...) (contract api.ContractMetadata, err error)
- func (c *Client) FundAccount(ctx context.Context, account rhpv3.Account, fcid types.FileContractID, ...) (types.Currency, error)
- func (c *Client) GougingParams(ctx context.Context) (gp api.GougingParams, err error)
- func (c *Client) GougingSettings(ctx context.Context) (gs api.GougingSettings, err error)
- func (c *Client) Host(ctx context.Context, hostKey types.PublicKey) (h api.Host, err error)
- func (c *Client) HostAllowlist(ctx context.Context) (allowlist []types.PublicKey, err error)
- func (c *Client) HostBlocklist(ctx context.Context) (blocklist []string, err error)
- func (c *Client) Hosts(ctx context.Context, opts api.GetHostsOptions) (hosts []api.Host, err error)
- func (c *Client) HostsForScanning(ctx context.Context, opts api.HostsForScanningOptions) (hosts []api.HostAddress, err error)
- func (c *Client) KeepaliveContract(ctx context.Context, contractID types.FileContractID, lockID uint64, ...) (err error)
- func (c *Client) ListBuckets(ctx context.Context) (buckets []api.Bucket, err error)
- func (c *Client) ListObjects(ctx context.Context, bucket string, opts api.ListObjectOptions) (resp api.ObjectsListResponse, err error)
- func (c *Client) MarkPackedSlabsUploaded(ctx context.Context, slabs []api.UploadedPackedSlab) (err error)
- func (c *Client) MultipartUpload(ctx context.Context, uploadID string) (resp api.MultipartUpload, err error)
- func (c *Client) MultipartUploadParts(ctx context.Context, bucket, path string, uploadID string, ...) (resp api.MultipartListPartsResponse, err error)
- func (c *Client) MultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, ...) (resp api.MultipartListUploadsResponse, err error)
- func (c *Client) Object(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (res api.ObjectsResponse, err error)
- func (c *Client) ObjectsBySlabKey(ctx context.Context, bucket string, key object.EncryptionKey) (objects []api.ObjectMetadata, err error)
- func (c *Client) ObjectsStats(ctx context.Context, opts api.ObjectsStatsOpts) (osr api.ObjectsStatsResponse, err error)
- func (c *Client) PackedSlabsForUpload(ctx context.Context, lockingDuration time.Duration, ...) (slabs []api.PackedSlab, err error)
- func (c *Client) PricePinningSettings(ctx context.Context) (pps api.PricePinSettings, err error)
- func (c *Client) PrunableData(ctx context.Context) (prunableData api.ContractsPrunableDataResponse, err error)
- func (c *Client) PruneContract(ctx context.Context, contractID types.FileContractID, timeout time.Duration) (res api.ContractPruneResponse, err error)
- func (c *Client) PruneMetrics(ctx context.Context, metric string, cutoff time.Time) error
- func (c *Client) RecommendedFee(ctx context.Context) (fee types.Currency, err error)
- func (c *Client) RecordContractPruneMetric(ctx context.Context, metrics ...api.ContractPruneMetric) error
- func (c *Client) RecordContractSetChurnMetric(ctx context.Context, metrics ...api.ContractSetChurnMetric) error
- func (c *Client) RecordContractSpending(ctx context.Context, records []api.ContractSpendingRecord) (err error)
- func (c *Client) RecordHostScans(ctx context.Context, scans []api.HostScan) (err error)
- func (c *Client) RecordPriceTables(ctx context.Context, priceTableUpdates []api.HostPriceTableUpdate) (err error)
- func (c *Client) RedundancySettings(ctx context.Context) (rs api.RedundancySettings, err error)
- func (c *Client) RefreshHealth(ctx context.Context) error
- func (c *Client) RegisterAlert(ctx context.Context, alert alerts.Alert) error
- func (c *Client) RegisterWebhook(ctx context.Context, webhook webhooks.Webhook) error
- func (c *Client) ReleaseContract(ctx context.Context, contractID types.FileContractID, lockID uint64) (err error)
- func (c *Client) RemoveOfflineHosts(ctx context.Context, maxConsecutiveScanFailures uint64, ...) (removed uint64, err error)
- func (c *Client) RenameObject(ctx context.Context, bucket, from, to string, force bool) (err error)
- func (c *Client) RenameObjects(ctx context.Context, bucket, from, to string, force bool) (err error)
- func (c *Client) RenewContract(ctx context.Context, contractID types.FileContractID, endHeight uint64, ...) (renewal api.ContractMetadata, err error)
- func (c *Client) RenewedContract(ctx context.Context, renewedFrom types.FileContractID) (contract api.ContractMetadata, err error)
- func (c *Client) ResetLostSectors(ctx context.Context, hostKey types.PublicKey) (err error)
- func (c *Client) S3AuthenticationSettings(ctx context.Context) (as api.S3AuthenticationSettings, err error)
- func (c *Client) SearchHosts(ctx context.Context, opts api.SearchHostOptions) (hosts []api.Host, err error)
- func (c *Client) SearchObjects(ctx context.Context, bucket string, opts api.SearchObjectOptions) (entries []api.ObjectMetadata, err error)
- func (c *Client) SendSiacoins(ctx context.Context, addr types.Address, amt types.Currency, ...) (txnID types.TransactionID, err error)
- func (c *Client) Setting(ctx context.Context, key string, value interface{}) (err error)
- func (c *Client) Settings(ctx context.Context) (settings []string, err error)
- func (c *Client) Slab(ctx context.Context, key object.EncryptionKey) (slab object.Slab, err error)
- func (c *Client) SlabBuffers() (buffers []api.SlabBuffer, err error)
- func (c *Client) SlabsForMigration(ctx context.Context, healthCutoff float64, set string, limit int) (slabs []api.UnhealthySlab, err error)
- func (c *Client) State() (state api.BusStateResponse, err error)
- func (c *Client) SyncerAddress(ctx context.Context) (addr string, err error)
- func (c *Client) SyncerConnect(ctx context.Context, addr string) (err error)
- func (c *Client) SyncerPeers(ctx context.Context) (resp []string, err error)
- func (c *Client) TrackUpload(ctx context.Context, uID api.UploadID) (err error)
- func (c *Client) TransactionPool(ctx context.Context) (txns []types.Transaction, err error)
- func (c *Client) UnregisterWebhook(ctx context.Context, webhook webhooks.Webhook) error
- func (c *Client) UpdateAccounts(ctx context.Context, accounts []api.Account) (err error)
- func (c *Client) UpdateAutopilot(ctx context.Context, autopilot api.Autopilot) (err error)
- func (c *Client) UpdateBucketPolicy(ctx context.Context, bucketName string, policy api.BucketPolicy) error
- func (c *Client) UpdateContractSet(ctx context.Context, set string, toAdd, toRemove []types.FileContractID) (err error)
- func (c *Client) UpdateHostAllowlist(ctx context.Context, add, remove []types.PublicKey, clear bool) (err error)
- func (c *Client) UpdateHostBlocklist(ctx context.Context, add, remove []string, clear bool) (err error)
- func (c *Client) UpdateHostCheck(ctx context.Context, autopilotID string, hostKey types.PublicKey, ...) (err error)
- func (c *Client) UpdateSetting(ctx context.Context, key string, value interface{}) error
- func (c *Client) UpdateSlab(ctx context.Context, slab object.Slab, contractSet string) (err error)
- func (c *Client) UploadPackingSettings(ctx context.Context) (ups api.UploadPackingSettings, err error)
- func (c *Client) UploadParams(ctx context.Context) (up api.UploadParams, err error)
- func (c *Client) Wallet(ctx context.Context) (resp api.WalletResponse, err error)
- func (c *Client) WalletDiscard(ctx context.Context, txn types.Transaction) error
- func (c *Client) WalletFund(ctx context.Context, txn *types.Transaction, amount types.Currency, ...) ([]types.Hash256, []types.Transaction, error)
- func (c *Client) WalletMetrics(ctx context.Context, start time.Time, n uint64, interval time.Duration, ...) ([]api.WalletMetric, error)
- func (c *Client) WalletOutputs(ctx context.Context) (resp []api.SiacoinElement, err error)
- func (c *Client) WalletPending(ctx context.Context) (resp []types.Transaction, err error)
- func (c *Client) WalletRedistribute(ctx context.Context, outputs int, amount types.Currency) (ids []types.TransactionID, err error)
- func (c *Client) WalletSign(ctx context.Context, txn *types.Transaction, toSign []types.Hash256, ...) error
- func (c *Client) WalletTransactions(ctx context.Context, opts ...api.WalletTransactionsOption) (resp []api.Transaction, err error)
- func (c *Client) Webhooks(ctx context.Context) (resp api.WebhookResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides methods for interacting with a bus.
func (*Client) AbortMultipartUpload ¶
func (c *Client) AbortMultipartUpload(ctx context.Context, bucket, path string, uploadID string) (err error)
AbortMultipartUpload aborts a multipart upload.
func (*Client) AcceptBlock ¶
AcceptBlock submits a block to the consensus manager.
func (*Client) AcquireContract ¶
func (c *Client) AcquireContract(ctx context.Context, contractID types.FileContractID, priority int, d time.Duration) (lockID uint64, err error)
AcquireContract acquires a contract for a given amount of time unless released manually before that time.
func (*Client) AddContract ¶
func (c *Client) AddContract(ctx context.Context, contract rhpv2.ContractRevision, contractPrice, totalCost types.Currency, startHeight uint64, state string) (added api.ContractMetadata, err error)
AddContract adds the provided contract to the metadata store.
func (*Client) AddMultipartPart ¶
func (c *Client) AddMultipartPart(ctx context.Context, bucket, path, contractSet, eTag, uploadID string, partNumber int, slices []object.SlabSlice) (err error)
AddMultipartPart adds a part to a multipart upload.
func (*Client) AddObject ¶
func (c *Client) AddObject(ctx context.Context, bucket, path, contractSet string, o object.Object, opts api.AddObjectOptions) (err error)
AddObject stores the provided object under the given path.
func (*Client) AddPartialSlab ¶
func (c *Client) AddPartialSlab(ctx context.Context, data []byte, minShards, totalShards uint8, contractSet string) (slabs []object.SlabSlice, slabBufferMaxSizeSoftReached bool, err error)
AddPartialSlab adds a partial slab to the bus.
func (*Client) AddRenewedContract ¶
func (c *Client) AddRenewedContract(ctx context.Context, contract rhpv2.ContractRevision, contractPrice, totalCost types.Currency, startHeight uint64, renewedFrom types.FileContractID, state string) (renewed api.ContractMetadata, err error)
AddRenewedContract adds the provided contract to the metadata store.
func (*Client) AddUploadingSector ¶
func (c *Client) AddUploadingSector(ctx context.Context, uID api.UploadID, id types.FileContractID, root types.Hash256) (err error)
AddUploadingSector adds the given sector to the upload with given id.
func (*Client) Alerts ¶
func (c *Client) Alerts(ctx context.Context, opts alerts.AlertsOpts) (resp alerts.AlertsResponse, err error)
Alerts fetches the active alerts from the bus.
func (*Client) AncestorContracts ¶
func (c *Client) AncestorContracts(ctx context.Context, contractID types.FileContractID, minStartHeight uint64) (contracts []api.ArchivedContract, err error)
AncestorContracts returns any ancestors of a given contract.
func (*Client) ArchiveContracts ¶
func (c *Client) ArchiveContracts(ctx context.Context, toArchive map[types.FileContractID]string) (err error)
ArchiveContracts archives the contracts with the given IDs and archival reason.
func (*Client) Autopilots ¶
Autopilots returns all autopilots in the autopilots store.
func (*Client) BroadcastAction ¶
BroadcastAction broadcasts an action that triggers a webhook.
func (*Client) BroadcastContract ¶ added in v1.1.0
func (c *Client) BroadcastContract(ctx context.Context, contractID types.FileContractID) (txnID types.TransactionID, err error)
BroadcastContract broadcasts the latest revision for a contract.
func (*Client) BroadcastTransaction ¶
BroadcastTransaction broadcasts the transaction set to the network.
func (*Client) CompleteMultipartUpload ¶
func (c *Client) CompleteMultipartUpload(ctx context.Context, bucket, path, uploadID string, parts []api.MultipartCompletedPart, opts api.CompleteMultipartOptions) (resp api.MultipartCompleteResponse, err error)
CompleteMultipartUpload completes a multipart upload.
func (*Client) ConsensusNetwork ¶
ConsensusNetwork returns information about the consensus network.
func (*Client) ConsensusState ¶
ConsensusState returns the current block height and whether the node is synced.
func (*Client) Contract ¶
func (c *Client) Contract(ctx context.Context, id types.FileContractID) (contract api.ContractMetadata, err error)
Contract returns the contract with the given ID.
func (*Client) ContractMetrics ¶
func (*Client) ContractPruneMetrics ¶
func (*Client) ContractRoots ¶
func (c *Client) ContractRoots(ctx context.Context, contractID types.FileContractID) (roots, uploading []types.Hash256, err error)
ContractRoots returns the sector roots, as well as the ones that are still uploading, for the contract with given id.
func (*Client) ContractSetChurnMetrics ¶
func (*Client) ContractSetMetrics ¶
func (*Client) ContractSetSettings ¶
ContractSetSettings returns the contract set settings.
func (*Client) ContractSets ¶
ContractSets returns the contract sets of the bus.
func (*Client) ContractSize ¶
func (c *Client) ContractSize(ctx context.Context, contractID types.FileContractID) (size api.ContractSize, err error)
ContractSize returns the contract's size.
func (*Client) Contracts ¶
func (c *Client) Contracts(ctx context.Context, opts api.ContractsOpts) (contracts []api.ContractMetadata, err error)
Contracts retrieves contracts from the metadata store. If no filter is set, all contracts are returned.
func (*Client) CopyObject ¶
func (c *Client) CopyObject(ctx context.Context, srcBucket, dstBucket, srcPath, dstPath string, opts api.CopyObjectOptions) (om api.ObjectMetadata, err error)
CopyObject copies the object from the source bucket and path to the destination bucket and path.
func (*Client) CreateBucket ¶
func (c *Client) CreateBucket(ctx context.Context, bucketName string, opts api.CreateBucketOptions) error
CreateBucket creates a new bucket.
func (*Client) CreateMultipartUpload ¶
func (c *Client) CreateMultipartUpload(ctx context.Context, bucket, path string, opts api.CreateMultipartOptions) (resp api.MultipartCreateResponse, err error)
CreateMultipartUpload creates a new multipart upload.
func (*Client) DeleteAllContracts ¶
DeleteAllContracts deletes all contracts from the bus.
func (*Client) DeleteBucket ¶
DeleteBucket deletes an existing bucket. Fails if the bucket isn't empty.
func (*Client) DeleteContract ¶
DeleteContract deletes the contract with the given ID.
func (*Client) DeleteContractSet ¶
DeleteContractSet removes the contract set from the bus.
func (*Client) DeleteContracts ¶
DeleteContracts deletes the contracts with the given IDs.
func (*Client) DeleteHostSector ¶
func (c *Client) DeleteHostSector(ctx context.Context, hostKey types.PublicKey, sectorRoot types.Hash256) error
DeleteHostSector deletes the given sector on host with given host key.
func (*Client) DeleteObject ¶
func (c *Client) DeleteObject(ctx context.Context, bucket, path string, opts api.DeleteObjectOptions) (err error)
DeleteObject either deletes the object at the given path or if batch=true deletes all objects that start with the given path.
func (*Client) DeleteSetting ¶
DeleteSetting will delete the setting with given key.
func (*Client) DismissAlerts ¶
DismissAlerts dimisses the alerts with the given IDs.
func (*Client) FetchPartialSlab ¶
func (c *Client) FetchPartialSlab(ctx context.Context, key object.EncryptionKey, offset, length uint32) ([]byte, error)
FetchPartialSlab fetches a partial slab from the bus.
func (*Client) FileContractTax ¶
func (c *Client) FileContractTax(ctx context.Context, payout types.Currency) (tax types.Currency, err error)
FileContractTax asks the bus for the siafund fee that has to be paid for a contract with a given payout.
func (*Client) FinishUpload ¶
FinishUpload marks the given upload as finished.
func (*Client) FormContract ¶ added in v1.1.0
func (c *Client) FormContract(ctx context.Context, renterAddress types.Address, renterFunds types.Currency, hostKey types.PublicKey, hostIP string, hostCollateral types.Currency, endHeight uint64) (contract api.ContractMetadata, err error)
FormContract forms a contract with a host and adds it to the bus.
func (*Client) FundAccount ¶ added in v1.1.0
func (*Client) GougingParams ¶
GougingParams returns parameters used for performing gouging checks.
func (*Client) GougingSettings ¶
GougingSettings returns the gouging settings.
func (*Client) HostAllowlist ¶
HostAllowlist returns the allowlist.
func (*Client) HostBlocklist ¶
HostBlocklist returns a host blocklist.
func (*Client) HostsForScanning ¶
func (c *Client) HostsForScanning(ctx context.Context, opts api.HostsForScanningOptions) (hosts []api.HostAddress, err error)
HostsForScanning returns 'limit' host addresses at given 'offset' which haven't been scanned after lastScan.
func (*Client) KeepaliveContract ¶
func (c *Client) KeepaliveContract(ctx context.Context, contractID types.FileContractID, lockID uint64, d time.Duration) (err error)
KeepaliveContract extends the duration on an already acquired lock on a contract.
func (*Client) ListBuckets ¶
ListBuckets lists all available buckets.
func (*Client) ListObjects ¶
func (c *Client) ListObjects(ctx context.Context, bucket string, opts api.ListObjectOptions) (resp api.ObjectsListResponse, err error)
ListOBjects lists objects in the given bucket.
func (*Client) MarkPackedSlabsUploaded ¶
func (c *Client) MarkPackedSlabsUploaded(ctx context.Context, slabs []api.UploadedPackedSlab) (err error)
MarkPackedSlabsUploaded marks the given slabs as uploaded.
func (*Client) MultipartUpload ¶
func (c *Client) MultipartUpload(ctx context.Context, uploadID string) (resp api.MultipartUpload, err error)
MultipartUpload returns information about a specific multipart upload.
func (*Client) MultipartUploadParts ¶
func (c *Client) MultipartUploadParts(ctx context.Context, bucket, path string, uploadID string, partNumberMarker int, limit int64) (resp api.MultipartListPartsResponse, err error)
MultipartUploadParts returns information about all parts of a multipart upload.
func (*Client) MultipartUploads ¶
func (c *Client) MultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, maxUploads int) (resp api.MultipartListUploadsResponse, err error)
MultipartUploads returns information about all multipart uploads.
func (*Client) Object ¶
func (c *Client) Object(ctx context.Context, bucket, path string, opts api.GetObjectOptions) (res api.ObjectsResponse, err error)
Objects returns the object at given path.
func (*Client) ObjectsBySlabKey ¶
func (c *Client) ObjectsBySlabKey(ctx context.Context, bucket string, key object.EncryptionKey) (objects []api.ObjectMetadata, err error)
ObjectsBySlabKey returns all objects that reference a given slab.
func (*Client) ObjectsStats ¶
func (c *Client) ObjectsStats(ctx context.Context, opts api.ObjectsStatsOpts) (osr api.ObjectsStatsResponse, err error)
ObjectsStats returns information about the number of objects and their size.
func (*Client) PackedSlabsForUpload ¶
func (c *Client) PackedSlabsForUpload(ctx context.Context, lockingDuration time.Duration, minShards, totalShards uint8, set string, limit int) (slabs []api.PackedSlab, err error)
PackedSlabsForUpload returns packed slabs that are ready to upload.
func (*Client) PricePinningSettings ¶ added in v1.1.0
PricePinningSettings returns the contract set settings.
func (*Client) PrunableData ¶
func (c *Client) PrunableData(ctx context.Context) (prunableData api.ContractsPrunableDataResponse, err error)
PrunableData returns an overview of all contract sizes, the total size and the amount of data that can be pruned.
func (*Client) PruneContract ¶ added in v1.1.0
func (c *Client) PruneContract(ctx context.Context, contractID types.FileContractID, timeout time.Duration) (res api.ContractPruneResponse, err error)
PruneContract prunes the given contract.
func (*Client) PruneMetrics ¶
func (*Client) RecommendedFee ¶
RecommendedFee returns the recommended fee for a txn.
func (*Client) RecordContractPruneMetric ¶
func (*Client) RecordContractSetChurnMetric ¶
func (*Client) RecordContractSpending ¶
func (c *Client) RecordContractSpending(ctx context.Context, records []api.ContractSpendingRecord) (err error)
RecordContractSpending records contract spending metrics for contracts.
func (*Client) RecordHostScans ¶
RecordHostInteraction records an interaction for the supplied host.
func (*Client) RecordPriceTables ¶
func (c *Client) RecordPriceTables(ctx context.Context, priceTableUpdates []api.HostPriceTableUpdate) (err error)
RecordHostInteraction records an interaction for the supplied host.
func (*Client) RedundancySettings ¶
RedundancySettings returns the redundancy settings.
func (*Client) RefreshHealth ¶
RefreshHealth recomputes the cached health of all slabs.
func (*Client) RegisterAlert ¶
RegisterAlert registers the given alert.
func (*Client) RegisterWebhook ¶
RegisterWebhook registers the given webhook.
func (*Client) ReleaseContract ¶
func (c *Client) ReleaseContract(ctx context.Context, contractID types.FileContractID, lockID uint64) (err error)
ReleaseContract releases a contract that was previously acquired using AcquireContract.
func (*Client) RemoveOfflineHosts ¶
func (c *Client) RemoveOfflineHosts(ctx context.Context, maxConsecutiveScanFailures uint64, maxDowntime time.Duration) (removed uint64, err error)
RemoveOfflineHosts removes all hosts that have been offline for longer than the given max downtime.
func (*Client) RenameObject ¶
RenameObject renames a single object.
func (*Client) RenameObjects ¶
func (c *Client) RenameObjects(ctx context.Context, bucket, from, to string, force bool) (err error)
RenameObjects renames all objects with the prefix 'from' to the prefix 'to'.
func (*Client) RenewContract ¶ added in v1.1.0
func (c *Client) RenewContract(ctx context.Context, contractID types.FileContractID, endHeight uint64, renterFunds, minNewCollateral, maxFundAmount types.Currency, expectedStorage uint64) (renewal api.ContractMetadata, err error)
RenewContract renews an existing contract with a host and adds it to the bus.
func (*Client) RenewedContract ¶
func (c *Client) RenewedContract(ctx context.Context, renewedFrom types.FileContractID) (contract api.ContractMetadata, err error)
RenewedContract returns the renewed contract for the given ID.
func (*Client) ResetLostSectors ¶
ResetLostSectors resets the lost sector count for a host.
func (*Client) S3AuthenticationSettings ¶
func (c *Client) S3AuthenticationSettings(ctx context.Context) (as api.S3AuthenticationSettings, err error)
S3AuthenticationSettings returns the S3 authentication settings.
func (*Client) SearchHosts ¶
func (c *Client) SearchHosts(ctx context.Context, opts api.SearchHostOptions) (hosts []api.Host, err error)
SearchHosts returns all hosts that match certain search criteria.
func (*Client) SearchObjects ¶
func (c *Client) SearchObjects(ctx context.Context, bucket string, opts api.SearchObjectOptions) (entries []api.ObjectMetadata, err error)
SearchObjects returns all objects that contains a sub-string in their key.
func (*Client) SendSiacoins ¶
func (c *Client) SendSiacoins(ctx context.Context, addr types.Address, amt types.Currency, useUnconfirmedTxns bool) (txnID types.TransactionID, err error)
SendSiacoins is a helper method that sends siacoins to the given address.
func (*Client) SlabBuffers ¶
func (c *Client) SlabBuffers() (buffers []api.SlabBuffer, err error)
SlabBuffers returns information about the number of objects and their size.
func (*Client) SlabsForMigration ¶
func (c *Client) SlabsForMigration(ctx context.Context, healthCutoff float64, set string, limit int) (slabs []api.UnhealthySlab, err error)
SlabsForMigration returns up to 'limit' slabs which require migration. A slab needs to be migrated if it has sectors on contracts that are not part of the given 'set'.
func (*Client) State ¶
func (c *Client) State() (state api.BusStateResponse, err error)
State returns the current state of the bus.
func (*Client) SyncerAddress ¶
SyncerAddress returns the address the syncer is listening on.
func (*Client) SyncerConnect ¶
SyncerConnect adds the address as a peer of the syncer.
func (*Client) SyncerPeers ¶
SyncerPeers returns the current peers of the syncer.
func (*Client) TrackUpload ¶
TrackUpload tracks the upload with given id in the bus.
func (*Client) TransactionPool ¶
TransactionPool returns the transactions currently in the pool.
func (*Client) UnregisterWebhook ¶ added in v1.1.0
UnregisterWebhook unregisters the given webhook.
func (*Client) UpdateAccounts ¶ added in v1.1.0
UpdateAccounts saves all accounts.
func (*Client) UpdateAutopilot ¶
UpdateAutopilot updates the given autopilot in the store.
func (*Client) UpdateBucketPolicy ¶
func (c *Client) UpdateBucketPolicy(ctx context.Context, bucketName string, policy api.BucketPolicy) error
UpdateBucketPolicy updates the policy of an existing bucket.
func (*Client) UpdateContractSet ¶ added in v1.1.0
func (c *Client) UpdateContractSet(ctx context.Context, set string, toAdd, toRemove []types.FileContractID) (err error)
UpdateContractSet adds/removes the given contracts to/from the given set.
func (*Client) UpdateHostAllowlist ¶
func (c *Client) UpdateHostAllowlist(ctx context.Context, add, remove []types.PublicKey, clear bool) (err error)
UpdateHostAllowlist updates the host allowlist, adding and removing the given entries.
func (*Client) UpdateHostBlocklist ¶
func (c *Client) UpdateHostBlocklist(ctx context.Context, add, remove []string, clear bool) (err error)
UpdateHostBlocklist updates the host blocklist, adding and removing the given entries.
func (*Client) UpdateHostCheck ¶ added in v1.0.7
func (c *Client) UpdateHostCheck(ctx context.Context, autopilotID string, hostKey types.PublicKey, hostCheck api.HostCheck) (err error)
UpdateHostCheck updates the host with the most recent check performed by the autopilot with given id.
func (*Client) UpdateSetting ¶
UpdateSetting will update the given setting under the given key.
func (*Client) UpdateSlab ¶
UpdateSlab updates the given slab in the database.
func (*Client) UploadPackingSettings ¶
func (c *Client) UploadPackingSettings(ctx context.Context) (ups api.UploadPackingSettings, err error)
UploadPackingSettings returns the upload packing settings.
func (*Client) UploadParams ¶
UploadParams returns parameters used for uploading slabs.
func (*Client) WalletDiscard ¶
WalletDiscard discards the provided txn, make its inputs usable again. This should only be called on transactions that will never be broadcast.
func (*Client) WalletFund ¶
func (c *Client) WalletFund(ctx context.Context, txn *types.Transaction, amount types.Currency, useUnconfirmedTransactions bool) ([]types.Hash256, []types.Transaction, error)
WalletFund funds txn using inputs controlled by the wallet.
func (*Client) WalletMetrics ¶
func (*Client) WalletOutputs ¶
WalletOutputs returns the set of unspent outputs controlled by the wallet.
func (*Client) WalletPending ¶
WalletPending returns the txpool transactions that are relevant to the wallet.
func (*Client) WalletRedistribute ¶
func (c *Client) WalletRedistribute(ctx context.Context, outputs int, amount types.Currency) (ids []types.TransactionID, err error)
WalletRedistribute broadcasts a transaction that redistributes the money in the wallet in the desired number of outputs of given amount. If the transaction was successfully broadcasted it will return the transaction ID.
func (*Client) WalletSign ¶
func (c *Client) WalletSign(ctx context.Context, txn *types.Transaction, toSign []types.Hash256, cf types.CoveredFields) error
WalletSign signs txn using the wallet's private key.
func (*Client) WalletTransactions ¶
func (c *Client) WalletTransactions(ctx context.Context, opts ...api.WalletTransactionsOption) (resp []api.Transaction, err error)
WalletTransactions returns all transactions relevant to the wallet.