Documentation
¶
Index ¶
- Constants
- Variables
- func CompareTimeRFC3339(t1, t2 TimeRFC3339) bool
- func FormatETag(ETag string) string
- func ObjectPathEscape(path string) string
- type Account
- type AccountHandlerPOST
- type AccountsAddBalanceRequest
- type AccountsLockHandlerRequest
- type AccountsLockHandlerResponse
- type AccountsRequiresSyncRequest
- type AccountsUnlockHandlerRequest
- type AccountsUpdateBalanceRequest
- type AddObjectOptions
- type AddPartialSlabResponse
- type ArchivedContract
- type Autopilot
- type AutopilotConfig
- type AutopilotStateResponse
- type AutopilotTriggerRequest
- type AutopilotTriggerResponse
- type Bucket
- type BucketCreateRequest
- type BucketPolicy
- type BucketUpdatePolicyRequest
- type BuildState
- type BusStateResponse
- type ConsensusNetwork
- type ConsensusState
- type Contract
- type ContractAcquireRequest
- type ContractAcquireResponse
- type ContractAddRequest
- type ContractKeepaliveRequest
- type ContractMetadata
- type ContractMetric
- type ContractMetricRequestPUT
- type ContractMetricsQueryOpts
- type ContractPrunableData
- type ContractPruneMetric
- type ContractPruneMetricRequestPUT
- type ContractPruneMetricsQueryOpts
- type ContractReleaseRequest
- type ContractRenewedRequest
- type ContractRootsResponse
- type ContractSetChurnMetric
- type ContractSetChurnMetricRequestPUT
- type ContractSetChurnMetricsQueryOpts
- type ContractSetMetric
- type ContractSetMetricsQueryOpts
- type ContractSetSetting
- type ContractSize
- type ContractSpending
- type ContractSpendingRecord
- type ContractsArchiveRequest
- type ContractsConfig
- type ContractsPrunableDataResponse
- type ContractsResponse
- type CopyObjectOptions
- type CreateBucketOptions
- type CreateMultipartOptions
- type DeleteObjectOptions
- type DownloadObjectOptions
- type DownloadRange
- type DownloadStatsResponse
- type DownloaderStats
- type DurationH
- type DurationMS
- type GetHostsOptions
- type GetObjectOptions
- type GetObjectResponse
- type GougingParams
- type GougingSettings
- type HostGougingBreakdown
- type HostHandlerResponse
- type HostHandlerResponseChecks
- type HostScoreBreakdown
- type HostsConfig
- type HostsForScanningOptions
- type HostsPriceTablesRequest
- type HostsRemoveRequest
- type HostsScanRequest
- type ListObjectOptions
- type MemoryResponse
- type MemoryStatus
- type MigrateSlabResponse
- type MigrationSlabsRequest
- type MultipartAbortRequest
- type MultipartAddPartRequest
- type MultipartCompleteRequest
- type MultipartCompleteResponse
- type MultipartCompletedPart
- type MultipartCreateRequest
- type MultipartCreateResponse
- type MultipartListPartItem
- type MultipartListPartsRequest
- type MultipartListPartsResponse
- type MultipartListUploadsRequest
- type MultipartListUploadsResponse
- type MultipartUpload
- type Object
- type ObjectAddRequest
- type ObjectEntriesOptions
- type ObjectMetadata
- type ObjectsCopyRequest
- type ObjectsListRequest
- type ObjectsListResponse
- type ObjectsRenameRequest
- type ObjectsResponse
- type ObjectsStatsResponse
- type PackedSlab
- type PackedSlabsRequestGET
- type PackedSlabsRequestPOST
- type ParamCurrency
- type ParamString
- type PerformanceMetric
- type PerformanceMetricsQueryOpts
- type RHPFormRequest
- type RHPFormResponse
- type RHPFundRequest
- type RHPPreparePaymentRequest
- type RHPPriceTableRequest
- type RHPPruneContractRequest
- type RHPPruneContractResponse
- type RHPRegistryUpdateRequest
- type RHPRenewRequest
- type RHPRenewResponse
- type RHPScanRequest
- type RHPScanResponse
- type RHPSyncRequest
- type RedundancySettings
- type S3AuthenticationSettings
- type SearchHostOptions
- type SearchHostsRequest
- type SearchObjectOptions
- type SlabBuffer
- type SlabID
- type TimeRFC3339
- type UnhealthySlab
- type UnhealthySlabsResponse
- type UpdateAllowlistRequest
- type UpdateBlocklistRequest
- type UpdateSlabRequest
- type UploadID
- type UploadMultipartUploadPartOptions
- type UploadMultipartUploadPartResponse
- type UploadObjectOptions
- type UploadObjectResponse
- type UploadPackingSettings
- type UploadParams
- type UploadSectorRequest
- type UploadStatsResponse
- type UploadedPackedSlab
- type UploaderStats
- type WalletConfig
- type WalletFundRequest
- type WalletFundResponse
- type WalletMetric
- type WalletMetricsQueryOpts
- type WalletPrepareFormRequest
- type WalletPrepareRenewRequest
- type WalletPrepareRenewResponse
- type WalletRedistributeRequest
- type WalletResponse
- type WalletSignRequest
- type WalletTransactionsOption
- type WebHookResponse
- type WorkerStateResponse
Constants ¶
const ( // BlocksPerDay defines the amount of blocks that are mined in a day (one // block every 10 minutes roughly) BlocksPerDay = 144 // DefaultAutopilotID is the id of the autopilot. DefaultAutopilotID = "autopilot" )
const ( ContractStateInvalid = "invalid" ContractStateUnknown = "unknown" ContractStatePending = "pending" ContractStateActive = "active" ContractStateComplete = "complete" ContractStateFailed = "failed" )
const ( ContractArchivalReasonHostPruned = "hostpruned" ContractArchivalReasonRemoved = "removed" ContractArchivalReasonRenewed = "renewed" )
const ( HostFilterModeAll = "all" HostFilterModeAllowed = "allowed" HostFilterModeBlocked = "blocked" UsabilityFilterModeAll = "all" UsabilityFilterModeUsable = "usable" UsabilityFilterModeUnusable = "unusable" )
const ( ChurnDirAdded = "added" ChurnDirRemoved = "removed" MetricContractPrune = "contractprune" MetricContractSet = "contractset" MetricContractSetChurn = "churn" MetricContract = "contract" MetricPerformance = "performance" MetricWallet = "wallet" )
const ( ObjectsRenameModeSingle = "single" ObjectsRenameModeMulti = "multi" ObjectSortByHealth = "health" ObjectSortByName = "name" ObjectSortDirAsc = "asc" ObjectSortDirDesc = "desc" )
const ( SettingContractSet = "contractset" SettingGouging = "gouging" SettingRedundancy = "redundancy" SettingS3Authentication = "s3authentication" SettingUploadPacking = "uploadpacking" )
const ( S3MinAccessKeyLen = 16 S3MaxAccessKeyLen = 128 S3SecretKeyLen = 40 )
const (
DefaultBucketName = "default"
)
Variables ¶
var ( // ErrAutopilotNotFound is returned when an autopilot can't be found. ErrAutopilotNotFound = errors.New("couldn't find autopilot") // ErrMaxDowntimeHoursTooHigh is returned if the autopilot config is updated // with a value that exceeds the maximum of 99 years. ErrMaxDowntimeHoursTooHigh = errors.New("MaxDowntimeHours is too high, exceeds max value of 99 years") )
var ( // ErrBucketExists is returned when trying to create a bucket that already // exists. ErrBucketExists = errors.New("bucket already exists") // ErrBucketNotEmpty is returned when trying to delete a bucket that is not // empty. ErrBucketNotEmpty = errors.New("bucket not empty") // ErrBucketNotFound is returned when an bucket can't be retrieved from the // database. ErrBucketNotFound = errors.New("bucket not found") )
var ( // ErrContractNotFound is returned when a contract can't be retrieved from // the database. ErrContractNotFound = errors.New("couldn't find contract") // ErrContractSetNotFound is returned when a contract set can't be retrieved // from the database. ErrContractSetNotFound = errors.New("couldn't find contract set") )
var ( // ErrMultipartUploadNotFound is returned if the specified multipart upload // wasn't found. ErrMultipartUploadNotFound = errors.New("multipart upload not found") // ErrPartNotFound is returned if the specified part of a multipart upload // wasn't found. ErrPartNotFound = errors.New("multipart upload part not found") // ErrUploadAlreadyExists is returned when starting an upload with an id // that's already in use. ErrUploadAlreadyExists = errors.New("upload already exists") // ErrUnknownUpload is returned when adding sectors for an upload id that's // not known. ErrUnknownUpload = errors.New("unknown upload") )
var ( // ErrObjectExists is returned when an operation fails because an object // already exists. ErrObjectExists = errors.New("object already exists") // ErrObjectNotFound is returned when an object can't be retrieved from the // database. ErrObjectNotFound = errors.New("object not found") // ErrObjectCorrupted is returned if we were unable to retrieve the object // from the database. ErrObjectCorrupted = errors.New("object corrupted") // ErrInvalidObjectSortParameters is returned when invalid sort parameters // were provided ErrInvalidObjectSortParameters = errors.New("invalid sort parameters") )
var ( // ErrConsensusNotSynced is returned by the worker API by endpoints that rely on // consensus and the consensus is not synced. ErrConsensusNotSynced = errors.New("consensus is not synced") // ErrContractSetNotSpecified is returned by the worker API by endpoints that // need a contract set to be able to upload data. ErrContractSetNotSpecified = errors.New("contract set is not specified") )
var ( // ErrHostNotFound is returned when a host can't be retrieved from the // database. ErrHostNotFound = errors.New("host doesn't exist in hostdb") )
var ( // ErrRequiresSyncSetRecently indicates that an account can't be set to sync // yet because it has been set too recently. ErrRequiresSyncSetRecently = errors.New("account had 'requiresSync' flag set recently") )
var ( // ErrSettingNotFound is returned if a requested setting is not present in the // database. ErrSettingNotFound = errors.New("setting not found") )
Functions ¶
func CompareTimeRFC3339 ¶ added in v0.7.0
func CompareTimeRFC3339(t1, t2 TimeRFC3339) bool
CompareTimeRFC3339 is a comparer function to be used with cmp.Comparer.
func FormatETag ¶ added in v0.6.0
func ObjectPathEscape ¶ added in v0.7.0
Types ¶
type Account ¶
type Account struct { // ID identifies an account. It's a public key. ID rhpv3.Account `json:"id"` // CleanShutdown indicates whether the account was saved during a clean // shutdown CleanShutdown bool `json:"cleanShutdown"` // HostKey describes the host the account was created with. HostKey types.PublicKey `json:"hostKey"` // Balance is the balance of the account. Balance *big.Int `json:"balance"` // Drift is the accumulated delta between the bus' tracked balance for // an account and the balance reported by a host. Drift *big.Int `json:"drift"` // RequiresSync indicates whether an account needs to be synced with the // host before it can be used again. RequiresSync bool `json:"requiresSync"` }
type AccountHandlerPOST ¶
AccountHandlerPOST is the request type for the /account/:id endpoint.
type AccountsAddBalanceRequest ¶
type AccountsAddBalanceRequest struct { HostKey types.PublicKey `json:"hostKey"` Amount *big.Int `json:"amount"` }
AccountsAddBalanceRequest is the request type for /account/:id/add endpoint.
type AccountsLockHandlerRequest ¶
type AccountsLockHandlerRequest struct { HostKey types.PublicKey `json:"hostKey"` Exclusive bool `json:"exclusive"` Duration DurationMS `json:"duration"` }
AccountsLockHandlerRequest is the request type for the /accounts/:id/lock endpoint.
type AccountsLockHandlerResponse ¶
type AccountsLockHandlerResponse struct { Account Account `json:"account"` LockID uint64 `json:"lockID"` }
AccountsLockHandlerResponse is the response type for the /accounts/:id/lock
type AccountsRequiresSyncRequest ¶
AccountsRequiresSyncRequest is the request type for /account/:id/requiressync endpoint.
type AccountsUnlockHandlerRequest ¶
type AccountsUnlockHandlerRequest struct {
LockID uint64 `json:"lockID"`
}
AccountsUnlockHandlerRequest is the request type for the /accounts/:id/unlock
type AccountsUpdateBalanceRequest ¶
type AccountsUpdateBalanceRequest struct { HostKey types.PublicKey `json:"hostKey"` Amount *big.Int `json:"amount"` }
AccountsUpdateBalanceRequest is the request type for /account/:id/update endpoint.
type AddObjectOptions ¶ added in v0.7.0
type AddPartialSlabResponse ¶
type ArchivedContract ¶
type ArchivedContract struct { ID types.FileContractID `json:"id"` HostKey types.PublicKey `json:"hostKey"` RenewedTo types.FileContractID `json:"renewedTo"` Spending ContractSpending `json:"spending"` ProofHeight uint64 `json:"proofHeight"` RevisionHeight uint64 `json:"revisionHeight"` RevisionNumber uint64 `json:"revisionNumber"` Size uint64 `json:"size"` StartHeight uint64 `json:"startHeight"` State string `json:"state"` WindowStart uint64 `json:"windowStart"` WindowEnd uint64 `json:"windowEnd"` }
An ArchivedContract contains all information about a contract with a host that has been moved to the archive either due to expiring or being renewed.
type Autopilot ¶
type Autopilot struct { ID string `json:"id"` Config AutopilotConfig `json:"config"` CurrentPeriod uint64 `json:"currentPeriod"` }
Autopilot contains the autopilot's config and current period.
type AutopilotConfig ¶
type AutopilotConfig struct { Contracts ContractsConfig `json:"contracts"` Hosts HostsConfig `json:"hosts"` Wallet WalletConfig `json:"wallet"` }
AutopilotConfig contains all autopilot configuration.
func (AutopilotConfig) Validate ¶
func (c AutopilotConfig) Validate() error
type AutopilotStateResponse ¶
type AutopilotStateResponse struct { Configured bool `json:"configured"` Migrating bool `json:"migrating"` MigratingLastStart TimeRFC3339 `json:"migratingLastStart"` Pruning bool `json:"pruning"` PruningLastStart TimeRFC3339 `json:"pruningLastStart"` Scanning bool `json:"scanning"` ScanningLastStart TimeRFC3339 `json:"scanningLastStart"` UptimeMS DurationMS `json:"uptimeMs"` StartTime TimeRFC3339 `json:"startTime"` BuildState }
AutopilotStateResponse is the response type for the /autopilot/state endpoint.
type AutopilotTriggerRequest ¶
type AutopilotTriggerRequest struct {
ForceScan bool `json:"forceScan"`
}
AutopilotTriggerRequest is the request object used by the /trigger endpoint
type AutopilotTriggerResponse ¶
type AutopilotTriggerResponse struct {
Triggered bool `json:"triggered"`
}
AutopilotTriggerResponse is the response returned by the /trigger endpoint, indicating whether an autopilot loop was triggered.
type Bucket ¶ added in v0.6.0
type Bucket struct { CreatedAt TimeRFC3339 `json:"createdAt"` Name string `json:"name"` Policy BucketPolicy `json:"policy"` }
type BucketCreateRequest ¶ added in v0.6.0
type BucketCreateRequest struct { Name string `json:"name"` Policy BucketPolicy `json:"policy"` }
type BucketPolicy ¶ added in v0.6.0
type BucketPolicy struct {
PublicReadAccess bool `json:"publicReadAccess"`
}
type BucketUpdatePolicyRequest ¶ added in v0.6.0
type BucketUpdatePolicyRequest struct {
Policy BucketPolicy `json:"policy"`
}
type BuildState ¶
type BuildState struct { Network string `json:"network"` Version string `json:"version"` Commit string `json:"commit"` OS string `json:"os"` BuildTime TimeRFC3339 `json:"buildTime"` }
BuildState contains static information about the build.
type BusStateResponse ¶
type BusStateResponse struct { StartTime TimeRFC3339 `json:"startTime"` BuildState }
BusStateResponse is the response type for the /bus/state endpoint.
type ConsensusNetwork ¶
type ConsensusNetwork struct {
Name string
}
ConsensusNetwork holds the name of the network.
type ConsensusState ¶
type ConsensusState struct { BlockHeight uint64 `json:"blockHeight"` LastBlockTime TimeRFC3339 `json:"lastBlockTime"` Synced bool `json:"synced"` }
ConsensusState holds the current blockheight and whether we are synced or not.
type Contract ¶
type Contract struct { ContractMetadata Revision *types.FileContractRevision `json:"revision"` }
A Contract wraps the contract metadata with the latest contract revision.
func (Contract) EndHeight ¶
EndHeight returns the height at which the host is no longer obligated to store contract data.
func (Contract) RemainingCollateral ¶
RemainingCollateral returns the remaining collateral in the contract.
func (Contract) RenterFunds ¶
RenterFunds returns the funds remaining in the contract's Renter payout.
type ContractAcquireRequest ¶
type ContractAcquireRequest struct { Duration DurationMS `json:"duration"` Priority int `json:"priority"` }
ContractAcquireRequest is the request type for the /contract/acquire endpoint.
type ContractAcquireResponse ¶
type ContractAcquireResponse struct {
LockID uint64 `json:"lockID"`
}
ContractAcquireResponse is the response type for the /contract/:id/acquire endpoint.
type ContractAddRequest ¶ added in v0.7.0
type ContractAddRequest struct { Contract rhpv2.ContractRevision `json:"contract"` ContractPrice types.Currency `json:"contractPrice"` StartHeight uint64 `json:"startHeight"` State string `json:"state,omitempty"` TotalCost types.Currency `json:"totalCost"` }
ContractAddRequest is the request type for the /contract/:id endpoint.
type ContractKeepaliveRequest ¶
type ContractKeepaliveRequest struct { Duration DurationMS `json:"duration"` LockID uint64 `json:"lockID"` }
ContractKeepaliveRequest is the request type for the /contract/:id/keepalive endpoint.
type ContractMetadata ¶
type ContractMetadata struct { ID types.FileContractID `json:"id"` HostIP string `json:"hostIP"` HostKey types.PublicKey `json:"hostKey"` SiamuxAddr string `json:"siamuxAddr"` ProofHeight uint64 `json:"proofHeight"` RevisionHeight uint64 `json:"revisionHeight"` RevisionNumber uint64 `json:"revisionNumber"` Size uint64 `json:"size"` StartHeight uint64 `json:"startHeight"` State string `json:"state"` WindowStart uint64 `json:"windowStart"` WindowEnd uint64 `json:"windowEnd"` ContractPrice types.Currency `json:"contractPrice"` RenewedFrom types.FileContractID `json:"renewedFrom"` Spending ContractSpending `json:"spending"` TotalCost types.Currency `json:"totalCost"` }
ContractMetadata contains all metadata for a contract.
type ContractMetric ¶ added in v0.7.0
type ContractMetric struct { Timestamp TimeRFC3339 `json:"timestamp"` ContractID types.FileContractID `json:"contractID"` HostKey types.PublicKey `json:"hostKey"` RemainingCollateral types.Currency `json:"remainingCollateral"` RemainingFunds types.Currency `json:"remainingFunds"` RevisionNumber uint64 `json:"revisionNumber"` UploadSpending types.Currency `json:"uploadSpending"` DownloadSpending types.Currency `json:"downloadSpending"` FundAccountSpending types.Currency `json:"fundAccountSpending"` DeleteSpending types.Currency `json:"deleteSpending"` ListSpending types.Currency `json:"listSpending"` }
type ContractMetricRequestPUT ¶ added in v0.7.0
type ContractMetricRequestPUT struct {
Metrics []ContractMetric `json:"metrics"`
}
type ContractMetricsQueryOpts ¶ added in v0.7.0
type ContractMetricsQueryOpts struct { ContractID types.FileContractID HostKey types.PublicKey }
type ContractPrunableData ¶
type ContractPrunableData struct { ID types.FileContractID `json:"id"` ContractSize }
ContractPrunableData wraps a contract's size information with its id.
type ContractPruneMetric ¶ added in v0.7.0
type ContractPruneMetric struct { Timestamp time.Time `json:"timestamp"` ContractID types.FileContractID `json:"contractID"` HostKey types.PublicKey `json:"hostKey"` HostVersion string `json:"hostVersion"` Pruned uint64 `json:"pruned"` Remaining uint64 `json:"remaining"` Duration time.Duration `json:"duration"` }
type ContractPruneMetricRequestPUT ¶ added in v0.7.0
type ContractPruneMetricRequestPUT struct {
Metrics []ContractPruneMetric `json:"metrics"`
}
type ContractPruneMetricsQueryOpts ¶ added in v0.7.0
type ContractPruneMetricsQueryOpts struct { ContractID types.FileContractID HostKey types.PublicKey HostVersion string }
type ContractReleaseRequest ¶
type ContractReleaseRequest struct {
LockID uint64 `json:"lockID"`
}
ContractAcquireRequest is the request type for the /contract/:id/release endpoint.
type ContractRenewedRequest ¶ added in v0.7.0
type ContractRenewedRequest struct { Contract rhpv2.ContractRevision `json:"contract"` ContractPrice types.Currency `json:"contractPrice"` RenewedFrom types.FileContractID `json:"renewedFrom"` StartHeight uint64 `json:"startHeight"` State string `json:"state,omitempty"` TotalCost types.Currency `json:"totalCost"` }
ContractRenewedRequest is the request type for the /contract/:id/renewed endpoint.
type ContractRootsResponse ¶
type ContractRootsResponse struct { Roots []types.Hash256 `json:"roots"` Uploading []types.Hash256 `json:"uploading"` }
ContractRootsResponse is the response type for the /contract/:id/roots endpoint.
type ContractSetChurnMetric ¶ added in v0.7.0
type ContractSetChurnMetric struct { Direction string `json:"direction"` ContractID types.FileContractID `json:"contractID"` Name string `json:"name"` Reason string `json:"reason,omitempty"` Timestamp TimeRFC3339 `json:"timestamp"` }
type ContractSetChurnMetricRequestPUT ¶ added in v0.7.0
type ContractSetChurnMetricRequestPUT struct {
Metrics []ContractSetChurnMetric `json:"metrics"`
}
type ContractSetChurnMetricsQueryOpts ¶ added in v0.7.0
type ContractSetMetric ¶ added in v0.7.0
type ContractSetMetric struct { Contracts int `json:"contracts"` Name string `json:"name"` Timestamp TimeRFC3339 `json:"timestamp"` }
type ContractSetMetricsQueryOpts ¶ added in v0.7.0
type ContractSetMetricsQueryOpts struct {
Name string
}
type ContractSetSetting ¶
type ContractSetSetting struct {
Default string `json:"default"`
}
ContractSetSetting contains the default contract set used by the worker for uploads and migrations.
type ContractSize ¶
ContractSize contains information about the size of the contract and about how much of the contract data can be pruned.
type ContractSpending ¶
type ContractSpending struct { Uploads types.Currency `json:"uploads"` Downloads types.Currency `json:"downloads"` FundAccount types.Currency `json:"fundAccount"` Deletions types.Currency `json:"deletions"` SectorRoots types.Currency `json:"sectorRoots"` }
ContractSpending contains all spending details for a contract.
func (ContractSpending) Add ¶
func (x ContractSpending) Add(y ContractSpending) (z ContractSpending)
Add returns the sum of the current and given contract spending.
type ContractSpendingRecord ¶
type ContractSpendingRecord struct { ContractSpending ContractID types.FileContractID `json:"contractID"` RevisionNumber uint64 `json:"revisionNumber"` Size uint64 `json:"size"` MissedHostPayout types.Currency `json:"missedHostPayout"` ValidRenterPayout types.Currency `json:"validRenterPayout"` }
type ContractsArchiveRequest ¶ added in v0.7.0
type ContractsArchiveRequest = map[types.FileContractID]string
ContractsArchiveRequest is the request type for the /contracts/archive endpoint.
type ContractsConfig ¶
type ContractsConfig struct { Set string `json:"set"` Amount uint64 `json:"amount"` Allowance types.Currency `json:"allowance"` Period uint64 `json:"period"` RenewWindow uint64 `json:"renewWindow"` Download uint64 `json:"download"` Upload uint64 `json:"upload"` Storage uint64 `json:"storage"` Prune bool `json:"prune"` }
ContractsConfig contains all contract settings used in the autopilot.
type ContractsPrunableDataResponse ¶
type ContractsPrunableDataResponse struct { Contracts []ContractPrunableData `json:"contracts"` TotalPrunable uint64 `json:"totalPrunable"` TotalSize uint64 `json:"totalSize"` }
ContractsPrunableDataResponse is the response type for the /contracts/prunable endpoint.
type ContractsResponse ¶
type ContractsResponse struct { Contracts []Contract `json:"contracts"` Error string `json:"error,omitempty"` }
ContractsResponse is the response type for the /rhp/contracts endpoint.
type CopyObjectOptions ¶ added in v0.6.0
type CopyObjectOptions struct {
MimeType string
}
type CreateBucketOptions ¶ added in v0.7.0
type CreateBucketOptions struct {
Policy BucketPolicy
}
type CreateMultipartOptions ¶ added in v0.6.0
type CreateMultipartOptions struct { Key object.EncryptionKey MimeType string }
type DeleteObjectOptions ¶ added in v0.7.0
type DeleteObjectOptions struct {
Batch bool
}
func (DeleteObjectOptions) Apply ¶ added in v0.7.0
func (opts DeleteObjectOptions) Apply(values url.Values)
type DownloadObjectOptions ¶ added in v0.7.0
type DownloadObjectOptions struct { Prefix string Offset int Limit int Range DownloadRange }
func (DownloadObjectOptions) ApplyHeaders ¶ added in v0.7.0
func (opts DownloadObjectOptions) ApplyHeaders(h http.Header)
func (DownloadObjectOptions) ApplyValues ¶ added in v0.7.0
func (opts DownloadObjectOptions) ApplyValues(values url.Values)
type DownloadRange ¶ added in v0.6.0
func ParseDownloadRange ¶ added in v0.6.0
func ParseDownloadRange(contentRange string) (DownloadRange, error)
type DownloadStatsResponse ¶
type DownloadStatsResponse struct { AvgDownloadSpeedMBPS float64 `json:"avgDownloadSpeedMbps"` AvgOverdrivePct float64 `json:"avgOverdrivePct"` HealthyDownloaders uint64 `json:"healthyDownloaders"` NumDownloaders uint64 `json:"numDownloaders"` DownloadersStats []DownloaderStats `json:"downloadersStats"` }
DownloadStatsResponse is the response type for the /stats/downloads endpoint.
type DownloaderStats ¶
type DurationH ¶ added in v0.6.0
A DurationH aliases time.Duration to add marshaling functions that format the duration in hours.
func (DurationH) MarshalText ¶ added in v0.6.0
MarshalText implements encoding.TextMarshaler.
func (*DurationH) UnmarshalText ¶ added in v0.6.0
UnmarshalText implements encoding.TextUnmarshaler.
type DurationMS ¶ added in v0.6.0
A DurationMS is a duration encoded as an integer number of milliseconds.
func (DurationMS) MarshalJSON ¶ added in v0.6.0
func (d DurationMS) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (DurationMS) MarshalText ¶ added in v0.6.0
func (d DurationMS) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (DurationMS) String ¶ added in v0.6.0
func (d DurationMS) String() string
String implements fmt.Stringer.
func (*DurationMS) UnmarshalJSON ¶ added in v0.6.0
func (d *DurationMS) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*DurationMS) UnmarshalText ¶ added in v0.6.0
func (d *DurationMS) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type GetHostsOptions ¶ added in v0.7.0
Option types.
func (GetHostsOptions) Apply ¶ added in v0.7.0
func (opts GetHostsOptions) Apply(values url.Values)
type GetObjectOptions ¶ added in v0.7.0
func (GetObjectOptions) Apply ¶ added in v0.7.0
func (opts GetObjectOptions) Apply(values url.Values)
type GetObjectResponse ¶ added in v0.6.0
type GetObjectResponse struct { Content io.ReadCloser `json:"content"` ContentType string `json:"contentType"` ModTime TimeRFC3339 `json:"modTime"` Range *DownloadRange `json:"range,omitempty"` Size int64 `json:"size"` }
type GougingParams ¶
type GougingParams struct { ConsensusState ConsensusState GougingSettings GougingSettings RedundancySettings RedundancySettings TransactionFee types.Currency }
GougingParams contains the metadata needed by a worker to perform gouging checks.
type GougingSettings ¶
type GougingSettings struct { // MinMaxCollateral is the minimum value for 'MaxCollateral' in the host's // price settings MinMaxCollateral types.Currency `json:"minMaxCollateral"` // MaxRPCPrice is the maximum allowed base price for RPCs MaxRPCPrice types.Currency `json:"maxRPCPrice"` // MaxContractPrice is the maximum allowed price to form a contract MaxContractPrice types.Currency `json:"maxContractPrice"` // MaxDownloadPrice is the maximum allowed price to download 1TiB of data MaxDownloadPrice types.Currency `json:"maxDownloadPrice"` // MaxUploadPrice is the maximum allowed price to upload 1TiB of data MaxUploadPrice types.Currency `json:"maxUploadPrice"` // MaxStoragePrice is the maximum allowed price to store 1 byte per block MaxStoragePrice types.Currency `json:"maxStoragePrice"` // HostBlockHeightLeeway is the amount of blocks of leeway given to the host // block height in the host's price table HostBlockHeightLeeway int `json:"hostBlockHeightLeeway"` // MinPriceTableValidity is the minimum accepted value for `Validity` in the // host's price settings. MinPriceTableValidity time.Duration `json:"minPriceTableValidity"` // MinAccountExpiry is the minimum accepted value for `AccountExpiry` in the // host's price settings. MinAccountExpiry time.Duration `json:"minAccountExpiry"` // MinMaxEphemeralAccountBalance is the minimum accepted value for // `MaxEphemeralAccountBalance` in the host's price settings. MinMaxEphemeralAccountBalance types.Currency `json:"minMaxEphemeralAccountBalance"` // MigrationSurchargeMultiplier is the multiplier applied to the // 'MaxDownloadPrice' when checking whether a host is too expensive, // this multiplier is only applied for when trying to migrate critically // low-health slabs. MigrationSurchargeMultiplier uint64 `json:"migrationSurchargeMultiplier"` }
GougingSettings contain some price settings used in price gouging.
func (GougingSettings) Validate ¶
func (gs GougingSettings) Validate() error
Validate returns an error if the gouging settings are not considered valid.
type HostGougingBreakdown ¶
type HostGougingBreakdown struct { ContractErr string `json:"contractErr"` DownloadErr string `json:"downloadErr"` GougingErr string `json:"gougingErr"` PruneErr string `json:"pruneErr"` UploadErr string `json:"uploadErr"` }
func (HostGougingBreakdown) Gouging ¶
func (hgb HostGougingBreakdown) Gouging() bool
func (HostGougingBreakdown) String ¶ added in v0.7.0
func (hgb HostGougingBreakdown) String() string
type HostHandlerResponse ¶
type HostHandlerResponse struct { Host hostdb.Host `json:"host"` Checks *HostHandlerResponseChecks `json:"checks,omitempty"` }
HostHandlerResponse is the response type for the /host/:hostkey endpoint.
type HostHandlerResponseChecks ¶
type HostHandlerResponseChecks struct { Gouging bool `json:"gouging"` GougingBreakdown HostGougingBreakdown `json:"gougingBreakdown"` Score float64 `json:"score"` ScoreBreakdown HostScoreBreakdown `json:"scoreBreakdown"` Usable bool `json:"usable"` UnusableReasons []string `json:"unusableReasons"` }
type HostScoreBreakdown ¶
type HostScoreBreakdown struct { Age float64 `json:"age"` Collateral float64 `json:"collateral"` Interactions float64 `json:"interactions"` StorageRemaining float64 `json:"storageRemaining"` Uptime float64 `json:"uptime"` Version float64 `json:"version"` Prices float64 `json:"prices"` }
func (HostScoreBreakdown) Score ¶
func (sb HostScoreBreakdown) Score() float64
func (HostScoreBreakdown) String ¶
func (sb HostScoreBreakdown) String() string
type HostsConfig ¶
type HostsConfig struct { AllowRedundantIPs bool `json:"allowRedundantIPs"` MaxDowntimeHours uint64 `json:"maxDowntimeHours"` MinRecentScanFailures uint64 `json:"minRecentScanFailures"` ScoreOverrides map[types.PublicKey]float64 `json:"scoreOverrides"` }
HostsConfig contains all hosts settings used in the autopilot.
type HostsForScanningOptions ¶ added in v0.7.0
type HostsForScanningOptions struct { MaxLastScan TimeRFC3339 Limit int Offset int }
Option types.
func (HostsForScanningOptions) Apply ¶ added in v0.7.0
func (opts HostsForScanningOptions) Apply(values url.Values)
type HostsPriceTablesRequest ¶
type HostsPriceTablesRequest struct {
PriceTableUpdates []hostdb.PriceTableUpdate `json:"priceTableUpdates"`
}
HostsPriceTablesRequest is the request type for the /hosts/pricetables endpoint.
type HostsRemoveRequest ¶
type HostsRemoveRequest struct { MaxDowntimeHours DurationH `json:"maxDowntimeHours"` MinRecentScanFailures uint64 `json:"minRecentScanFailures"` }
HostsRemoveRequest is the request type for the /hosts/remove endpoint.
type HostsScanRequest ¶
HostsScanRequest is the request type for the /hosts/scans endpoint.
type ListObjectOptions ¶ added in v0.7.0
type MemoryResponse ¶ added in v0.7.0
type MemoryResponse struct { Download MemoryStatus `json:"download"` Upload MemoryStatus `json:"upload"` }
type MemoryStatus ¶ added in v0.7.0
type MigrateSlabResponse ¶ added in v0.6.0
type MigrateSlabResponse struct { NumShardsMigrated int `json:"numShardsMigrated"` SurchargeApplied bool `json:"surchargeApplied,omitempty"` Error string `json:"error,omitempty"` }
MigrateSlabResponse is the response type for the /slab/migrate endpoint.
type MigrationSlabsRequest ¶
type MigrationSlabsRequest struct { ContractSet string `json:"contractSet"` HealthCutoff float64 `json:"healthCutoff"` Limit int `json:"limit"` }
MigrationSlabsRequest is the request type for the /slabs/migration endpoint.
type MultipartAbortRequest ¶ added in v0.6.0
type MultipartAddPartRequest ¶ added in v0.6.0
type MultipartCompleteRequest ¶ added in v0.6.0
type MultipartCompleteRequest struct { Bucket string `json:"bucket"` Path string `json:"path"` UploadID string `json:"uploadID"` Parts []MultipartCompletedPart }
type MultipartCompleteResponse ¶ added in v0.6.0
type MultipartCompleteResponse struct {
ETag string `json:"eTag"`
}
type MultipartCompletedPart ¶ added in v0.6.0
type MultipartCreateRequest ¶ added in v0.6.0
type MultipartCreateRequest struct { Bucket string `json:"bucket"` Path string `json:"path"` Key object.EncryptionKey `json:"key"` MimeType string `json:"mimeType"` }
type MultipartCreateResponse ¶ added in v0.6.0
type MultipartCreateResponse struct {
UploadID string `json:"uploadID"`
}
type MultipartListPartItem ¶ added in v0.6.0
type MultipartListPartItem struct { PartNumber int `json:"partNumber"` LastModified TimeRFC3339 `json:"lastModified"` ETag string `json:"eTag"` Size int64 `json:"size"` }
type MultipartListPartsRequest ¶ added in v0.6.0
type MultipartListPartsResponse ¶ added in v0.6.0
type MultipartListPartsResponse struct { HasMore bool `json:"hasMore"` NextMarker int `json:"nextMarker"` Parts []MultipartListPartItem `json:"parts"` }
type MultipartListUploadsRequest ¶ added in v0.6.0
type MultipartListUploadsResponse ¶ added in v0.6.0
type MultipartListUploadsResponse struct { HasMore bool `json:"hasMore"` NextPathMarker string `json:"nextMarker"` NextUploadIDMarker string `json:"nextUploadIDMarker"` Uploads []MultipartUpload `json:"uploads"` }
type MultipartUpload ¶ added in v0.6.0
type MultipartUpload struct { Bucket string `json:"bucket"` Key object.EncryptionKey `json:"key"` Path string `json:"path"` UploadID string `json:"uploadID"` CreatedAt TimeRFC3339 `json:"createdAt"` }
type Object ¶
type Object struct { ObjectMetadata object.Object }
Object wraps an object.Object with its metadata.
type ObjectAddRequest ¶
type ObjectAddRequest struct { Bucket string `json:"bucket"` ContractSet string `json:"contractSet"` Object object.Object `json:"object"` MimeType string `json:"mimeType"` ETag string `json:"eTag"` }
ObjectAddRequest is the request type for the /bus/object/*key endpoint.
type ObjectEntriesOptions ¶ added in v0.7.0
type ObjectMetadata ¶
type ObjectMetadata struct { ETag string `json:"eTag,omitempty"` Health float64 `json:"health"` MimeType string `json:"mimeType,omitempty"` ModTime TimeRFC3339 `json:"modTime"` Name string `json:"name"` Size int64 `json:"size"` }
ObjectMetadata contains various metadata about an object.
func (ObjectMetadata) ContentType ¶ added in v0.6.0
func (o ObjectMetadata) ContentType() string
ContentType returns the object's MimeType for use in the 'Content-Type' header, if the object's mime type is empty we try and deduce it from the extension in the object's name.
func (ObjectMetadata) LastModified ¶ added in v0.6.0
func (o ObjectMetadata) LastModified() string
LastModified returns the object's ModTime formatted for use in the 'Last-Modified' header
type ObjectsCopyRequest ¶ added in v0.6.0
type ObjectsCopyRequest struct { SourceBucket string `json:"sourceBucket"` SourcePath string `json:"sourcePath"` DestinationBucket string `json:"destinationBucket"` DestinationPath string `json:"destinationPath"` MimeType string `json:"mimeType"` }
ObjectsCopyRequest is the request type for the /bus/objects/copy endpoint.
type ObjectsListRequest ¶ added in v0.6.0
type ObjectsListRequest struct { Bucket string `json:"bucket"` Limit int `json:"limit"` SortBy string `json:"sortBy"` SortDir string `json:"sortDir"` Prefix string `json:"prefix"` Marker string `json:"marker"` }
ObjectsDeleteRequest is the request type for the /bus/objects/list endpoint.
type ObjectsListResponse ¶ added in v0.6.0
type ObjectsListResponse struct { HasMore bool `json:"hasMore"` NextMarker string `json:"nextMarker"` Objects []ObjectMetadata `json:"objects"` }
ObjectsListResponse is the response type for the /bus/objects/list endpoint.
type ObjectsRenameRequest ¶
type ObjectsRenameRequest struct { Bucket string `json:"bucket"` Force bool `json:"force"` From string `json:"from"` To string `json:"to"` Mode string `json:"mode"` }
ObjectsRenameRequest is the request type for the /bus/objects/rename endpoint.
type ObjectsResponse ¶
type ObjectsResponse struct { HasMore bool `json:"hasMore"` Entries []ObjectMetadata `json:"entries,omitempty"` Object *Object `json:"object,omitempty"` }
ObjectsResponse is the response type for the /bus/objects endpoint.
type ObjectsStatsResponse ¶
type ObjectsStatsResponse struct { NumObjects uint64 `json:"numObjects"` // number of objects MinHealth float64 `json:"minHealth"` // minimum health of all objects TotalObjectsSize uint64 `json:"totalObjectsSize"` // size of all objects TotalSectorsSize uint64 `json:"totalSectorsSize"` // uploaded size of all objects TotalUploadedSize uint64 `json:"totalUploadedSize"` // uploaded size of all objects including redundant sectors }
ObjectsStatsResponse is the response type for the /bus/stats/objects endpoint.
type PackedSlab ¶
type PackedSlab struct { BufferID uint `json:"bufferID"` Data []byte `json:"data"` Key object.EncryptionKey `json:"key"` }
type PackedSlabsRequestGET ¶
type PackedSlabsRequestGET struct { LockingDuration DurationMS `json:"lockingDuration"` MinShards uint8 `json:"minShards"` TotalShards uint8 `json:"totalShards"` ContractSet string `json:"contractSet"` Limit int `json:"limit"` }
type PackedSlabsRequestPOST ¶
type PackedSlabsRequestPOST struct {
Slabs []UploadedPackedSlab `json:"slabs"`
}
type ParamCurrency ¶
ParamCurrency aliases types.Currency and marshal them in hastings.
func (ParamCurrency) MarshalText ¶
func (c ParamCurrency) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (ParamCurrency) String ¶
func (c ParamCurrency) String() string
String implements fmt.Stringer.
func (*ParamCurrency) UnmarshalText ¶
func (c *ParamCurrency) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type ParamString ¶
type ParamString string
ParamString is a helper type since jape expects query params to implement the TextMarshaler interface.
func (ParamString) MarshalText ¶
func (s ParamString) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (*ParamString) UnmarshalText ¶
func (s *ParamString) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type PerformanceMetric ¶ added in v0.7.0
type PerformanceMetricsQueryOpts ¶ added in v0.7.0
type RHPFormRequest ¶
type RHPFormRequest struct { EndHeight uint64 `json:"endHeight"` HostCollateral types.Currency `json:"hostCollateral"` HostKey types.PublicKey `json:"hostKey"` HostIP string `json:"hostIP"` RenterFunds types.Currency `json:"renterFunds"` RenterAddress types.Address `json:"renterAddress"` }
RHPFormRequest is the request type for the /rhp/form endpoint.
type RHPFormResponse ¶
type RHPFormResponse struct { ContractID types.FileContractID `json:"contractID"` Contract rhpv2.ContractRevision `json:"contract"` TransactionSet []types.Transaction `json:"transactionSet"` }
RHPFormResponse is the response type for the /rhp/form endpoint.
type RHPFundRequest ¶
type RHPFundRequest struct { ContractID types.FileContractID `json:"contractID"` HostKey types.PublicKey `json:"hostKey"` SiamuxAddr string `json:"siamuxAddr"` Balance types.Currency `json:"balance"` }
RHPFundRequest is the request type for the /rhp/fund endpoint.
type RHPPreparePaymentRequest ¶
type RHPPreparePaymentRequest struct { Account rhpv3.Account `json:"account"` Amount types.Currency `json:"amount"` Expiry uint64 `json:"expiry"` AccountKey types.PrivateKey `json:"accountKey"` }
RHPPreparePaymentRequest is the request type for the /rhp/prepare/payment endpoint.
type RHPPriceTableRequest ¶
type RHPPriceTableRequest struct { HostKey types.PublicKey `json:"hostKey"` SiamuxAddr string `json:"siamuxAddr"` Timeout DurationMS `json:"timeout"` }
RHPPriceTableRequest is the request type for the /rhp/pricetable endpoint.
type RHPPruneContractRequest ¶ added in v0.6.0
type RHPPruneContractRequest struct {
Timeout DurationMS `json:"timeout"`
}
RHPPruneContractRequest is the request type for the /rhp/contract/:id/prune endpoint.
type RHPPruneContractResponse ¶ added in v0.6.0
type RHPPruneContractResponse struct { Pruned uint64 `json:"pruned"` Remaining uint64 `json:"remaining"` Error string `json:"error,omitempty"` }
RHPPruneContractResponse is the response type for the /rhp/contract/:id/prune endpoint.
type RHPRegistryUpdateRequest ¶
type RHPRegistryUpdateRequest struct { HostKey types.PublicKey `json:"hostKey"` SiamuxAddr string `json:"siamuxAddr"` RegistryKey rhpv3.RegistryKey `json:"registryKey"` RegistryValue rhpv3.RegistryValue `json:"registryValue"` }
RHPRegistryUpdateRequest is the request type for the /rhp/registry/update endpoint.
type RHPRenewRequest ¶
type RHPRenewRequest struct { ContractID types.FileContractID `json:"contractID"` EndHeight uint64 `json:"endHeight"` ExpectedNewStorage uint64 `json:"expectedNewStorage"` HostAddress types.Address `json:"hostAddress"` HostKey types.PublicKey `json:"hostKey"` MinNewCollateral types.Currency `json:"minNewCollateral"` SiamuxAddr string `json:"siamuxAddr"` RenterAddress types.Address `json:"renterAddress"` RenterFunds types.Currency `json:"renterFunds"` WindowSize uint64 `json:"windowSize"` }
RHPRenewRequest is the request type for the /rhp/renew endpoint.
type RHPRenewResponse ¶
type RHPRenewResponse struct { Error string `json:"error"` ContractID types.FileContractID `json:"contractID"` Contract rhpv2.ContractRevision `json:"contract"` ContractPrice types.Currency `json:"contractPrice"` TransactionSet []types.Transaction `json:"transactionSet"` }
RHPRenewResponse is the response type for the /rhp/renew endpoint.
type RHPScanRequest ¶
type RHPScanRequest struct { HostKey types.PublicKey `json:"hostKey"` HostIP string `json:"hostIP"` Timeout DurationMS `json:"timeout"` }
RHPScanRequest is the request type for the /rhp/scan endpoint.
type RHPScanResponse ¶
type RHPScanResponse struct { Ping DurationMS `json:"ping"` ScanError string `json:"scanError,omitempty"` Settings rhpv2.HostSettings `json:"settings,omitempty"` PriceTable rhpv3.HostPriceTable `json:"priceTable,omitempty"` }
RHPScanResponse is the response type for the /rhp/scan endpoint.
type RHPSyncRequest ¶
type RHPSyncRequest struct { ContractID types.FileContractID `json:"contractID"` HostKey types.PublicKey `json:"hostKey"` SiamuxAddr string `json:"siamuxAddr"` }
RHPSyncRequest is the request type for the /rhp/sync endpoint.
type RedundancySettings ¶
type RedundancySettings struct { MinShards int `json:"minShards"` TotalShards int `json:"totalShards"` }
RedundancySettings contain settings that dictate an object's redundancy.
func (RedundancySettings) Redundancy ¶
func (rs RedundancySettings) Redundancy() float64
Redundancy returns the effective storage redundancy of the RedundancySettings.
func (RedundancySettings) SlabSizeNoRedundancy ¶ added in v0.7.0
func (rs RedundancySettings) SlabSizeNoRedundancy() uint64
SlabSizeNoRedundancy returns the size of a slab without added redundancy.
func (RedundancySettings) Validate ¶
func (rs RedundancySettings) Validate() error
Validate returns an error if the redundancy settings are not considered valid.
type S3AuthenticationSettings ¶ added in v0.6.0
S3AuthenticationSettings contains S3 auth settings.
func (S3AuthenticationSettings) Validate ¶ added in v0.7.0
func (s3as S3AuthenticationSettings) Validate() error
Validate returns an error if the authentication settings are not considered valid.
type SearchHostOptions ¶ added in v0.7.0
type SearchHostOptions struct { AddressContains string FilterMode string KeyIn []types.PublicKey Limit int Offset int }
Option types.
func DefaultSearchHostOptions ¶ added in v0.7.0
func DefaultSearchHostOptions() SearchHostOptions
type SearchHostsRequest ¶
type SearchObjectOptions ¶ added in v0.7.0
func (SearchObjectOptions) Apply ¶ added in v0.7.0
func (opts SearchObjectOptions) Apply(values url.Values)
type SlabBuffer ¶
type SlabBuffer struct { ContractSet string `json:"contractSet"` // contract set that be buffer will be uploaded to Complete bool `json:"complete"` // whether the slab buffer is complete and ready to upload Filename string `json:"filename"` // name of the buffer on disk Size int64 `json:"size"` // size of the buffer MaxSize int64 `json:"maxSize"` // maximum size of the buffer Locked bool `json:"locked"` // whether the slab buffer is locked for uploading }
type SlabID ¶
type SlabID uint
A SlabID uniquely identifies a slab.
func (*SlabID) LoadString ¶
LoadString is implemented for jape's DecodeParam.
type TimeRFC3339 ¶ added in v0.6.0
TimeRFC3339 aliases time.Time to add marshaling functions that url escape and format a time in the RFC3339 format.
func TimeNow ¶ added in v0.7.0
func TimeNow() TimeRFC3339
TimeNow returns the current time as a TimeRFC3339.
func (TimeRFC3339) IsZero ¶ added in v0.7.0
func (t TimeRFC3339) IsZero() bool
IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC.
func (TimeRFC3339) MarshalJSON ¶ added in v0.6.0
func (t TimeRFC3339) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (TimeRFC3339) Std ¶ added in v0.7.0
func (t TimeRFC3339) Std() time.Time
Std converts a TimeRFC3339 to a time.Time.
func (TimeRFC3339) String ¶ added in v0.6.0
func (t TimeRFC3339) String() string
String implements fmt.Stringer.
func (*TimeRFC3339) UnmarshalText ¶ added in v0.6.0
func (t *TimeRFC3339) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type UnhealthySlab ¶
type UnhealthySlab struct { Key object.EncryptionKey `json:"key"` Health float64 `json:"health"` }
type UnhealthySlabsResponse ¶
type UnhealthySlabsResponse struct {
Slabs []UnhealthySlab `json:"slabs"`
}
type UpdateAllowlistRequest ¶
type UpdateAllowlistRequest struct { Add []types.PublicKey `json:"add"` Remove []types.PublicKey `json:"remove"` Clear bool `json:"clear"` }
UpdateAllowlistRequest is the request type for /hosts/allowlist endpoint.
type UpdateBlocklistRequest ¶
type UpdateBlocklistRequest struct { Add []string `json:"add"` Remove []string `json:"remove"` Clear bool `json:"clear"` }
UpdateBlocklistRequest is the request type for /hosts/blocklist endpoint.
type UpdateSlabRequest ¶
type UpdateSlabRequest struct { ContractSet string `json:"contractSet"` Slab object.Slab `json:"slab"` }
UpdateSlabRequest is the request type for the /slab endpoint.
type UploadID ¶
type UploadID [8]byte
UploadID identifies an ongoing upload.
func NewUploadID ¶
func NewUploadID() (uID UploadID)
func (UploadID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*UploadID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type UploadMultipartUploadPartOptions ¶ added in v0.7.0
type UploadMultipartUploadPartOptions struct { DisablePreshardingEncryption bool EncryptionOffset int ContentLength int64 }
func (UploadMultipartUploadPartOptions) Apply ¶ added in v0.7.0
func (opts UploadMultipartUploadPartOptions) Apply(values url.Values)
type UploadMultipartUploadPartResponse ¶ added in v0.6.0
type UploadMultipartUploadPartResponse struct {
ETag string `json:"etag"`
}
type UploadObjectOptions ¶ added in v0.7.0
type UploadObjectOptions struct { Offset int MinShards int TotalShards int ContractSet string MimeType string DisablePreshardingEncryption bool ContentLength int64 }
func (UploadObjectOptions) Apply ¶ added in v0.7.0
func (opts UploadObjectOptions) Apply(values url.Values)
type UploadObjectResponse ¶ added in v0.6.0
type UploadObjectResponse struct {
ETag string `json:"etag"`
}
type UploadPackingSettings ¶
type UploadPackingSettings struct { Enabled bool `json:"enabled"` SlabBufferMaxSizeSoft int64 `json:"slabBufferMaxSizeSoft"` }
UploadPackingSettings contains upload packing settings.
type UploadParams ¶
type UploadParams struct { CurrentHeight uint64 ContractSet string UploadPacking bool GougingParams }
UploadParams contains the metadata needed by a worker to upload an object.
type UploadSectorRequest ¶
type UploadSectorRequest struct { ContractID types.FileContractID `json:"contractID"` Root types.Hash256 `json:"root"` }
UploadSectorRequest is the request type for the /upload/:id/sector endpoint.
type UploadStatsResponse ¶
type UploadStatsResponse struct { AvgSlabUploadSpeedMBPS float64 `json:"avgSlabUploadSpeedMbps"` AvgOverdrivePct float64 `json:"avgOverdrivePct"` HealthyUploaders uint64 `json:"healthyUploaders"` NumUploaders uint64 `json:"numUploaders"` UploadersStats []UploaderStats `json:"uploadersStats"` }
UploadStatsResponse is the response type for the /stats/uploads endpoint.
type UploadedPackedSlab ¶
func (UploadedPackedSlab) Contracts ¶ added in v0.7.0
func (s UploadedPackedSlab) Contracts() map[types.PublicKey]map[types.FileContractID]struct{}
type UploaderStats ¶
type WalletConfig ¶
type WalletConfig struct {
DefragThreshold uint64 `json:"defragThreshold"`
}
WalletConfig contains all wallet settings used in the autopilot.
type WalletFundRequest ¶
type WalletFundRequest struct { Transaction types.Transaction `json:"transaction"` Amount types.Currency `json:"amount"` UseUnconfirmedTxns bool `json:"useUnconfirmedTxns"` }
WalletFundRequest is the request type for the /wallet/fund endpoint.
type WalletFundResponse ¶
type WalletFundResponse struct { Transaction types.Transaction `json:"transaction"` ToSign []types.Hash256 `json:"toSign"` DependsOn []types.Transaction `json:"dependsOn"` }
WalletFundResponse is the response type for the /wallet/fund endpoint.
type WalletMetric ¶ added in v0.7.0
type WalletMetricsQueryOpts ¶ added in v0.7.0
type WalletMetricsQueryOpts struct{}
type WalletPrepareFormRequest ¶
type WalletPrepareFormRequest struct { EndHeight uint64 `json:"endHeight"` HostCollateral types.Currency `json:"hostCollateral"` HostKey types.PublicKey `json:"hostKey"` HostSettings rhpv2.HostSettings `json:"hostSettings"` RenterAddress types.Address `json:"renterAddress"` RenterFunds types.Currency `json:"renterFunds"` RenterKey types.PublicKey `json:"renterKey"` }
WalletPrepareFormRequest is the request type for the /wallet/prepare/form endpoint.
type WalletPrepareRenewRequest ¶
type WalletPrepareRenewRequest struct { Revision types.FileContractRevision `json:"revision"` EndHeight uint64 `json:"endHeight"` ExpectedNewStorage uint64 `json:"expectedNewStorage"` HostAddress types.Address `json:"hostAddress"` PriceTable rhpv3.HostPriceTable `json:"priceTable"` MinNewCollateral types.Currency `json:"minNewCollateral"` RenterAddress types.Address `json:"renterAddress"` RenterFunds types.Currency `json:"renterFunds"` RenterKey types.PrivateKey `json:"renterKey"` WindowSize uint64 `json:"windowSize"` }
WalletPrepareRenewRequest is the request type for the /wallet/prepare/renew endpoint.
type WalletPrepareRenewResponse ¶
type WalletPrepareRenewResponse struct { ToSign []types.Hash256 `json:"toSign"` TransactionSet []types.Transaction `json:"transactionSet"` }
WalletPrepareRenewResponse is the response type for the /wallet/prepare/renew endpoint.
type WalletRedistributeRequest ¶
type WalletRedistributeRequest struct { Amount types.Currency `json:"amount"` Outputs int `json:"outputs"` }
WalletRedistributeRequest is the request type for the /wallet/redistribute endpoint.
type WalletResponse ¶
type WalletResponse struct { ScanHeight uint64 `json:"scanHeight"` Address types.Address `json:"address"` Spendable types.Currency `json:"spendable"` Confirmed types.Currency `json:"confirmed"` Unconfirmed types.Currency `json:"unconfirmed"` }
WalletResponse is the response type for the /wallet endpoint.
type WalletSignRequest ¶
type WalletSignRequest struct { Transaction types.Transaction `json:"transaction"` ToSign []types.Hash256 `json:"toSign"` CoveredFields types.CoveredFields `json:"coveredFields"` }
WalletSignRequest is the request type for the /wallet/sign endpoint.
type WalletTransactionsOption ¶
WalletTransactionsOption is an option for the WalletTransactions method.
func WalletTransactionsWithBefore ¶
func WalletTransactionsWithBefore(before time.Time) WalletTransactionsOption
func WalletTransactionsWithLimit ¶
func WalletTransactionsWithLimit(limit int) WalletTransactionsOption
func WalletTransactionsWithOffset ¶
func WalletTransactionsWithOffset(offset int) WalletTransactionsOption
func WalletTransactionsWithSince ¶
func WalletTransactionsWithSince(since time.Time) WalletTransactionsOption
type WebHookResponse ¶
type WebHookResponse struct { Webhooks []webhooks.Webhook `json:"webhooks"` Queues []webhooks.WebhookQueueInfo `json:"queues"` }
type WorkerStateResponse ¶
type WorkerStateResponse struct { ID string `json:"id"` StartTime TimeRFC3339 `json:"startTime"` BuildState }
WorkerStateResponse is the response type for the /worker/state endpoint.