models

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {

	// indicates the last time the siafile was accessed
	// Example: 2019-03-09T00:53:31.122129328Z
	// Format: date-time
	Accesstime strfmt.DateTime `json:"accesstime,omitempty"`

	// true if the file is available for download. Files may be available before they are completely uploaded.
	// Example: true
	Available bool `json:"available,omitempty"`

	// indicates the last time the siafile metadata was updated
	// Example: 2019-03-09T00:53:31.122129328Z
	// Format: date-time
	Changetime strfmt.DateTime `json:"changetime,omitempty"`

	// indicates the encryption used for the siafile
	// Example: threefish512
	Ciphertype string `json:"ciphertype,omitempty"`

	// indicates when the siafile was created
	// Example: 2019-03-08T13:18:49.47866608Z
	// Format: date-time
	Createtime strfmt.DateTime `json:"createtime,omitempty"`

	// Block height at which the file ceases availability.
	// Example: 60000
	Expiration int64 `json:"expiration,omitempty"`

	// Size of the file in bytes.
	// Example: 8192
	Filesize int64 `json:"filesize,omitempty"`

	// health is an indication of the amount of redundancy missing where 0 is full redundancy and >1 means the file is not available. The health of the siafile is the health of the worst unstuck chunk.
	// Example: 0.19
	Health float64 `json:"health,omitempty"`

	// Path to the local file on disk.
	// Example: /home/foo/bar.txt
	Localpath string `json:"localpath,omitempty"`

	// the maxhealth is either the health or the stuckhealth of the siafile, whichever is worst
	// Example: 0.25
	Maxhealth float64 `json:"maxhealth,omitempty"`

	// maxhealthpercent is the maxhealth converted to be out of 100% to be more easily understood
	// Example: 83.3334
	Maxhealthpercent float64 `json:"maxhealthpercent,omitempty"`

	// indicates the last time the siafile contents where modified
	// Example: 2019-03-09T00:53:31.122129328Z
	// Format: date-time
	Modtime strfmt.DateTime `json:"modtime,omitempty"`

	// indicates the number of stuck chunks in a file. A chunk is stuck if it cannot reach full redundancy
	// Example: 2
	Numstuckchunks int64 `json:"numstuckchunks,omitempty"`

	// indicates if the source file is found on disk
	// Example: true
	Ondisk bool `json:"ondisk,omitempty"`

	// indicates if the siafile is recoverable
	// Example: true
	Recoverable bool `json:"recoverable,omitempty"`

	// Average redundancy of the file on the network. Redundancy is calculated by dividing the amount of data uploaded in the file's open contracts by the size of the file. Redundancy does not necessarily correspond to availability. Specifically, a redundancy >= 1 does not indicate the file is available as there could be a chunk of the file with 0 redundancy.
	// Example: 5
	Redundancy float64 `json:"redundancy,omitempty"`

	// true if the file's contracts will be automatically renewed by the renter.
	// Example: true
	Renewing bool `json:"renewing,omitempty"`

	// Path to the file in the renter on the network.
	// Example: foo/bar.txt
	Siapath string `json:"siapath,omitempty"`

	// a file is stuck if there are any stuck chunks in the file, which means the file cannot reach full redundancy
	// Example: true
	Stuck bool `json:"stuck,omitempty"`

	// stuckhealth is the worst health of any of the stuck chunks.
	// Example: 0.25
	Stuckhealth float64 `json:"stuckhealth,omitempty"`

	// Total number of bytes successfully uploaded via current file contracts. This number includes padding and rendundancy, so a file with a size of 8192 bytes might be padded to 40 MiB and, with a redundancy of 5, encoded to 200 MiB for upload.
	// Example: 209715200
	Uploadedbytes int64 `json:"uploadedbytes,omitempty"`

	// Percentage of the file uploaded, including redundancy. Uploading has completed when uploadprogress is 100. Files may be available for download before upload progress is 100.
	// Example: 100
	Uploadprogress float64 `json:"uploadprogress,omitempty"`
}

FileInfo file info

swagger:model FileInfo

func (*FileInfo) ContextValidate added in v0.5.9

func (m *FileInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this file info based on context it is used

func (*FileInfo) MarshalBinary

func (m *FileInfo) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*FileInfo) UnmarshalBinary

func (m *FileInfo) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*FileInfo) Validate

func (m *FileInfo) Validate(formats strfmt.Registry) error

Validate validates this file info

type Hostdb

type Hostdb struct {

	// hosts
	Hosts []*HostdbHostsItems0 `json:"hosts"`
}

Hostdb hostdb

swagger:model Hostdb

func (*Hostdb) ContextValidate added in v0.5.9

func (m *Hostdb) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this hostdb based on the context it is used

func (*Hostdb) MarshalBinary

func (m *Hostdb) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Hostdb) UnmarshalBinary

func (m *Hostdb) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Hostdb) Validate

func (m *Hostdb) Validate(formats strfmt.Registry) error

Validate validates this hostdb

type HostdbHostsItems0

type HostdbHostsItems0 struct {

	// true if the host is accepting new contracts.
	// Example: true
	Acceptingcontracts bool `json:"acceptingcontracts,omitempty"`

	// The maximum amount of money that the host will put up as collateral for storage that is contracted by the renter.
	// Example: 20000000000
	Collateral string `json:"collateral,omitempty"`

	// The price that a renter has to pay to create a contract with the host. The payment is intended to cover transaction fees for the file contract revision and the storage proof that the host will be submitting to the blockchain.
	// Example: 1000000000000000000000000
	Contractprice string `json:"contractprice,omitempty"`

	// The price that a renter has to pay when downloading data from the host.
	// Example: 35000000000000
	Downloadbandwidthprice string `json:"downloadbandwidthprice,omitempty"`

	// Indicates if the host is currently being filtered from the HostDB
	// Example: false
	Filtered bool `json:"filtered,omitempty"`

	// Firstseen is the last block height at which this host was announced.
	// Example: 160000
	Firstseen int64 `json:"firstseen,omitempty"`

	// Total amount of time the host has been offline in nanosecounds.
	// Example: 0
	Historicdowntime int64 `json:"historicdowntime,omitempty"`

	// Number of historic failed interactions with the host.
	// Example: 0
	Historicfailedinteractions float64 `json:"historicfailedinteractions,omitempty"`

	// Number of historic successful interactions with the host.
	// Example: 5
	Historicsuccessfulinteractions float64 `json:"historicsuccessfulinteractions,omitempty"`

	// Total amount of time the host has been online in nanosecounds.
	// Example: 41634520900246580
	Historicuptime int64 `json:"historicuptime,omitempty"`

	// List of IP subnet masks used by the host. For IPv4 the /24 and for IPv6 the /54 subnet mask is used. A host can have either one IPv4 or one IPv6 subnet or one of each. E.g. these lists are valid: [ "IPv4" ], [ "IPv6" ] or [ "IPv4", "IPv6" ]. The following lists are invalid: [ "IPv4", "IPv4" ], [ "IPv4", "IPv6", "IPv6" ]. Hosts with an invalid list are ignored.
	Ipnets []string `json:"ipnets"`

	// The last time that the interactions within scanhistory have been compressed into the historic ones.
	// Example: 174900
	Lasthistoricupdate int64 `json:"lasthistoricupdate,omitempty"`

	// The last time the list of IP subnet masks was updated. When equal subnet masks are found for different hosts, the host that occupies the subnet mask for a longer time is preferred.
	// Example: 2015-01-01T08:00:00.000000000+04:00
	// Format: date-time
	Lastipnetchange strfmt.DateTime `json:"lastipnetchange,omitempty"`

	// The maximum amount of collateral that the host will put into a single file contract.
	// Example: 1000000000000000000000000000
	Maxcollateral string `json:"maxcollateral,omitempty"`

	// Maximum number of bytes that the host will allow to be requested by a single download request.
	// Example: 17825792
	Maxdownloadbatchsize int64 `json:"maxdownloadbatchsize,omitempty"`

	// Maximum duration in blocks that a host will allow for a file contract.
	// The host commits to keeping files for the full duration under the
	// threat of facing a large penalty for losing or dropping data before
	// the duration is complete. The storage proof window of an incoming file
	// contract must end before the current height + maxduration.
	// There is a block approximately every 10 minutes.
	// e.g. 1 day = 144 blocks
	//
	// Example: 25920
	Maxduration int64 `json:"maxduration,omitempty"`

	// Maximum size in bytes of a single batch of file contract
	// revisions. Larger batch sizes allow for higher throughput as there is
	// significant communication overhead associated with performing a batch
	// upload.
	//
	// Example: 17825792
	Maxrevisebatchsize int64 `json:"maxrevisebatchsize,omitempty"`

	// Remote address of the host. It can be an IPv4, IPv6, or hostname, along with the port. IPv6 addresses are enclosed in square brackets.
	// Example: 123.456.789.0:9982
	Netaddress string `json:"netaddress,omitempty"`

	// publickey
	Publickey *HostdbHostsItems0Publickey `json:"publickey,omitempty"`

	// The string representation of the full public key, used when calling /hostdb/hosts.
	// Example: ed25519:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
	Publickeystring string `json:"publickeystring,omitempty"`

	// Number of recent failed interactions with the host.
	// Example: 0
	Recentfailedinteractions int64 `json:"recentfailedinteractions,omitempty"`

	// Number of recent successful interactions with the host.
	// Example: 0
	Recentsuccessfulinteractions int64 `json:"recentsuccessfulinteractions,omitempty"`

	// Unused storage capacity the host claims it has, in bytes.
	// Example: 35000000000
	Remainingstorage int64 `json:"remainingstorage,omitempty"`

	// The revision number indicates to the renter what iteration of settings the host is currently at. Settings are generally signed. If the renter has multiple conflicting copies of settings from the host, the renter can expect the one with the higher revision number to be more recent.
	// Example: 12733798
	Revisionnumber int64 `json:"revisionnumber,omitempty"`

	// Measurements that have been taken on the host. The most recent measurements are kept in full detail.
	Scanhistory []*HostdbHostsItems0ScanhistoryItems0 `json:"scanhistory"`

	// Smallest amount of data in bytes that can be uploaded or downloaded to or from the host.
	// Example: 4194304
	Sectorsize int64 `json:"sectorsize,omitempty"`

	// The price that a renter has to pay to store files with the host.
	// Example: 14000000000
	Storageprice string `json:"storageprice,omitempty"`

	// Total amount of storage capacity the host claims it has, in bytes.
	// Example: 35000000000
	Totalstorage int64 `json:"totalstorage,omitempty"`

	// Address at which the host can be paid when forming file contracts.
	// Example: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab
	Unlockhash string `json:"unlockhash,omitempty"`

	// The price that a renter has to pay when uploading data to the host.
	Uploadbandwidthprice string `json:"uploadbandwidthprice,omitempty"`

	// The version of the host.
	// Example: 1.3.4
	Version string `json:"version,omitempty"`

	// A storage proof window is the number of blocks that the host has to get a storage proof onto the blockchain. The window size is the minimum size of window that the host will accept in a file contract.
	// Example: 144
	Windowsize int64 `json:"windowsize,omitempty"`
}

HostdbHostsItems0 hostdb hosts items0

swagger:model HostdbHostsItems0

func (*HostdbHostsItems0) ContextValidate added in v0.5.9

func (m *HostdbHostsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this hostdb hosts items0 based on the context it is used

func (*HostdbHostsItems0) MarshalBinary

func (m *HostdbHostsItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*HostdbHostsItems0) UnmarshalBinary

func (m *HostdbHostsItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*HostdbHostsItems0) Validate

func (m *HostdbHostsItems0) Validate(formats strfmt.Registry) error

Validate validates this hostdb hosts items0

type HostdbHostsItems0Publickey

type HostdbHostsItems0Publickey struct {

	// Algorithm used for signing and verification. Typically "ed25519".
	// Example: ed25519
	Algorithm string `json:"algorithm,omitempty"`

	// Key used to verify signed host messages.
	// Example: RW50cm9weSBpc24ndCB3aGF0IGl0IHVzZWQgdG8gYmU=
	Key string `json:"key,omitempty"`
}

HostdbHostsItems0Publickey Public key used to identify and verify hosts.

swagger:model HostdbHostsItems0Publickey

func (*HostdbHostsItems0Publickey) ContextValidate added in v0.5.9

func (m *HostdbHostsItems0Publickey) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this hostdb hosts items0 publickey based on context it is used

func (*HostdbHostsItems0Publickey) MarshalBinary

func (m *HostdbHostsItems0Publickey) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*HostdbHostsItems0Publickey) UnmarshalBinary

func (m *HostdbHostsItems0Publickey) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*HostdbHostsItems0Publickey) Validate

func (m *HostdbHostsItems0Publickey) Validate(formats strfmt.Registry) error

Validate validates this hostdb hosts items0 publickey

type HostdbHostsItems0ScanhistoryItems0 added in v0.5.7

type HostdbHostsItems0ScanhistoryItems0 struct {

	// success
	// Example: true
	Success bool `json:"success,omitempty"`

	// timestamp
	// Example: 2018-09-23T08:00:00.000000000+04:00
	// Format: date-time
	Timestamp strfmt.DateTime `json:"timestamp,omitempty"`
}

HostdbHostsItems0ScanhistoryItems0 hostdb hosts items0 scanhistory items0

swagger:model HostdbHostsItems0ScanhistoryItems0

func (*HostdbHostsItems0ScanhistoryItems0) ContextValidate added in v0.5.9

func (m *HostdbHostsItems0ScanhistoryItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this hostdb hosts items0 scanhistory items0 based on context it is used

func (*HostdbHostsItems0ScanhistoryItems0) MarshalBinary added in v0.5.7

func (m *HostdbHostsItems0ScanhistoryItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*HostdbHostsItems0ScanhistoryItems0) UnmarshalBinary added in v0.5.7

func (m *HostdbHostsItems0ScanhistoryItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*HostdbHostsItems0ScanhistoryItems0) Validate added in v0.5.7

Validate validates this hostdb hosts items0 scanhistory items0

type StandardError

type StandardError struct {

	// message
	Message string `json:"message,omitempty"`
}

StandardError standard error

swagger:model StandardError

func (*StandardError) ContextValidate added in v0.5.9

func (m *StandardError) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this standard error based on context it is used

func (*StandardError) MarshalBinary

func (m *StandardError) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*StandardError) UnmarshalBinary

func (m *StandardError) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*StandardError) Validate

func (m *StandardError) Validate(formats strfmt.Registry) error

Validate validates this standard error

type Transaction

type Transaction struct {

	// Block height at which the transaction was confirmed. If the transaction is unconfirmed the height will be the max value of an unsigned 64-bit integer.
	// Example: 50000
	Confirmationheight int64 `json:"confirmationheight,omitempty"`

	// Time, in unix time, at which a transaction was confirmed. If the transaction is unconfirmed the timestamp will be the max value of an unsigned 64-bit integer.
	// Example: 1257894000
	Confirmationtimestamp int64 `json:"confirmationtimestamp,omitempty"`

	// Array of processed inputs detailing the inputs to the transaction.
	Inputs []*TransactionInputsItems0 `json:"inputs"`

	// Array of processed outputs detailing the outputs of the transaction. Outputs related to file contracts are excluded.
	Outputs []*TransactionOutputsItems0 `json:"outputs"`

	// Raw transaction. The rest of the fields in the resposne are determined from this raw transaction. It is left undocumented here as the processed transaction (the rest of the fields in this object) are usually what is desired.
	Transaction interface{} `json:"transaction,omitempty"`

	// ID of the transaction from which the wallet transaction was derived.
	// Example: 1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef
	Transactionid string `json:"transactionid,omitempty"`
}

Transaction transaction

swagger:model Transaction

func (*Transaction) ContextValidate added in v0.5.9

func (m *Transaction) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this transaction based on the context it is used

func (*Transaction) MarshalBinary

func (m *Transaction) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*Transaction) UnmarshalBinary

func (m *Transaction) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*Transaction) Validate

func (m *Transaction) Validate(formats strfmt.Registry) error

Validate validates this transaction

type TransactionInputsItems0

type TransactionInputsItems0 struct {

	// Type of fund represented by the input. Possible values are 'siacoin input' and 'siafund input'.
	// Example: siacoin input
	Fundtype string `json:"fundtype,omitempty"`

	// The id of the output being spent.
	// Example: 1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef
	Parentid string `json:"parentid,omitempty"`

	// Address that is affected. For inputs (outgoing money), the related address is usually not important because the wallet arbitrarily selects which addresses will fund a transaction.
	// Example: 1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab
	Relatedaddress string `json:"relatedaddress,omitempty"`

	// Amount of funds that have been moved in the input.
	// Example: 1234
	Value string `json:"value,omitempty"`

	// true if the address is owned by the wallet.
	// Example: false
	Walletaddress bool `json:"walletaddress,omitempty"`
}

TransactionInputsItems0 transaction inputs items0

swagger:model TransactionInputsItems0

func (*TransactionInputsItems0) ContextValidate added in v0.5.9

func (m *TransactionInputsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this transaction inputs items0 based on context it is used

func (*TransactionInputsItems0) MarshalBinary

func (m *TransactionInputsItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TransactionInputsItems0) UnmarshalBinary

func (m *TransactionInputsItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TransactionInputsItems0) Validate

func (m *TransactionInputsItems0) Validate(formats strfmt.Registry) error

Validate validates this transaction inputs items0

type TransactionOutputsItems0

type TransactionOutputsItems0 struct {

	// Type of fund is represented by the output. Possible values are 'siacoin output', 'siafund output', 'claim output', and 'miner payout'. Siacoin outputs and claim outputs both relate to siacoins. Siafund outputs relate to siafunds. Miner payouts point to siacoins that have been spent on a miner payout. Because the destination of the miner payout is determined by the block and not the transaction, the data 'maturityheight', 'walletaddress', and 'relatedaddress' are left blank.
	// Example: siacoin output
	Fundtype string `json:"fundtype,omitempty"`

	// The id of the output that was created.
	// Example: 1234567890abcdef0123456789abcdef0123456789abcdef0123456789abcdef
	ID string `json:"id,omitempty"`

	// Block height the output becomes available to be spent. Siacoin outputs and siafund outputs mature immediately - their maturity height will always be the confirmation height of the transaction. Claim outputs cannot be spent until they have had 144 confirmations, thus the maturity height of a claim output will always be 144 larger than the confirmation height of the transaction.
	// Example: 50000
	Maturityheight int64 `json:"maturityheight,omitempty"`

	// Address that is affected. For outputs (incoming money), the related address field can be used to determine who has sent money to the wallet.
	// Example: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
	Relatedaddress string `json:"relatedaddress,omitempty"`

	// Amount of funds that have been moved in the output.
	// Example: 1234
	Value string `json:"value,omitempty"`

	// true if the address is owned by the wallet.
	// Example: false
	Walletaddress bool `json:"walletaddress,omitempty"`
}

TransactionOutputsItems0 transaction outputs items0

swagger:model TransactionOutputsItems0

func (*TransactionOutputsItems0) ContextValidate added in v0.5.9

func (m *TransactionOutputsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this transaction outputs items0 based on context it is used

func (*TransactionOutputsItems0) MarshalBinary

func (m *TransactionOutputsItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*TransactionOutputsItems0) UnmarshalBinary

func (m *TransactionOutputsItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*TransactionOutputsItems0) Validate

func (m *TransactionOutputsItems0) Validate(formats strfmt.Registry) error

Validate validates this transaction outputs items0

type TransactionSet

type TransactionSet []string

TransactionSet transaction set

swagger:model TransactionSet

func (TransactionSet) ContextValidate added in v0.5.9

func (m TransactionSet) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this transaction set based on context it is used

func (TransactionSet) Validate

func (m TransactionSet) Validate(formats strfmt.Registry) error

Validate validates this transaction set

Jump to

Keyboard shortcuts

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