Documentation ¶
Index ¶
- Variables
- type Change
- type ChangeIterator
- type ChangesFilterOpts
- type Historian
- func (h *Historian) FilterChanges(opts *ChangesFilterOpts, passportAddress common.Address) (*ChangeIterator, error)
- func (h *Historian) GetHistoryItemOfWriteAddress(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteAddressHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteBool(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBoolHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteBytes(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBytesHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteIPFSHash(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIPFSHashHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteInt(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIntHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteString(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteStringHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteTxData(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteTxDataHistoryItem, error)
- func (h *Historian) GetHistoryItemOfWriteUint(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteUintHistoryItem, error)
- type Provider
- func (p *Provider) DeleteAddress(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteBool(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteBytes(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteInt(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteString(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteTxData(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) DeleteUint(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
- func (p *Provider) WriteAddress(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error)
- func (p *Provider) WriteBool(ctx context.Context, passportAddress common.Address, key [32]byte, data bool) (common.Hash, error)
- func (p *Provider) WriteBytes(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error)
- func (p *Provider) WriteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte, hash string) (common.Hash, error)
- func (p *Provider) WriteInt(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error)
- func (p *Provider) WriteString(ctx context.Context, passportAddress common.Address, key [32]byte, data string) (common.Hash, error)
- func (p *Provider) WriteTxData(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error)
- func (p *Provider) WriteUint(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error)
- type Reader
- func (r *Reader) ReadAddress(ctx context.Context, passport common.Address, factProvider common.Address, ...) (common.Address, error)
- func (r *Reader) ReadBool(ctx context.Context, passport common.Address, factProvider common.Address, ...) (bool, error)
- func (r *Reader) ReadBytes(ctx context.Context, passport common.Address, factProvider common.Address, ...) ([]byte, error)
- func (r *Reader) ReadIPFSHash(ctx context.Context, passport common.Address, factProvider common.Address, ...) (string, error)
- func (r *Reader) ReadInt(ctx context.Context, passport common.Address, factProvider common.Address, ...) (*big.Int, error)
- func (r *Reader) ReadString(ctx context.Context, passport common.Address, factProvider common.Address, ...) (string, error)
- func (r *Reader) ReadTxData(ctx context.Context, passport common.Address, factProvider common.Address, ...) ([]byte, error)
- func (r *Reader) ReadUint(ctx context.Context, passport common.Address, factProvider common.Address, ...) (*big.Int, error)
- type WriteAddressHistoryItem
- type WriteBoolHistoryItem
- type WriteBytesHistoryItem
- type WriteIPFSHashHistoryItem
- type WriteIntHistoryItem
- type WriteStringHistoryItem
- type WriteTxDataHistoryItem
- type WriteUintHistoryItem
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIsNotAllowedFactProvider error returned when fact provider is not allowed to modify (write or delete) passport facts. ErrIsNotAllowedFactProvider = errors.New("facts: not allowed fact provider") // ErrOutOfUint256Range error returned when value is out of uint256 range [0; 2^256-1] ErrOutOfUint256Range = errors.New("facts: out of uint256 range") // ErrOutOfInt256Range error returned when value is out of int256 range [-2^255; 2^255-1] ErrOutOfInt256Range = errors.New("facts: out of int256 range") )
Functions ¶
This section is empty.
Types ¶
type Change ¶
type Change struct { // ChangeType represents type of data change ChangeType change.Type // DataType represents type of data DataType data.Type // Address of fact provider FactProvider common.Address // Key of the value Key [32]byte // Blockchain specific contextual infos Raw types.Log }
Change contains information about data change
type ChangeIterator ¶
type ChangeIterator struct { Change *Change // Change containing the info of the last retrieved change // contains filtered or unexported fields }
ChangeIterator is returned from FilterChanges and is used to iterate over the changes and unpacked data for Updated and Deleted events raised by the PassportLogic contract.
func (*ChangeIterator) Close ¶
func (it *ChangeIterator) Close() error
Close terminates the iteration process, releasing any pending underlying resources.
func (*ChangeIterator) Error ¶
func (it *ChangeIterator) Error() error
Error returns any retrieval or parsing error occurred during filtering.
func (*ChangeIterator) Next ¶
func (it *ChangeIterator) Next() bool
Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.
func (*ChangeIterator) ToSlice ¶
func (it *ChangeIterator) ToSlice() (ps []*Change, err error)
ToSlice retrieves all changes and saves them into slice.
type ChangesFilterOpts ¶
type ChangesFilterOpts struct { Start uint64 // Start of the queried range End *uint64 // End of the range (nil = latest) ChangeType []change.Type // ChangeType is a slice of change types to filter (nil = all change types) DataType []data.Type // DataType is a slice of data types to filter (nil = all data types) FactProvider []common.Address // FactProvider is a slice of fact providers to filter (nil = all fact providers) Key [][32]byte // Key is a slice of keys to filter (nil = all keys) Context context.Context // Network context to support cancellation and timeouts (nil = no timeout) }
ChangesFilterOpts is the collection of options to fine tune filtering for changes.
type Historian ¶
Historian reads the fact history
func (*Historian) FilterChanges ¶
func (h *Historian) FilterChanges(opts *ChangesFilterOpts, passportAddress common.Address) (*ChangeIterator, error)
FilterChanges retrieves changes from event log of passport.
func (*Historian) GetHistoryItemOfWriteAddress ¶
func (h *Historian) GetHistoryItemOfWriteAddress(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteAddressHistoryItem, error)
GetHistoryItemOfWriteAddress returns the data value that was set in the given transaction.
func (*Historian) GetHistoryItemOfWriteBool ¶
func (h *Historian) GetHistoryItemOfWriteBool(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBoolHistoryItem, error)
GetHistoryItemOfWriteBool returns the data value that was set in the given transaction.
func (*Historian) GetHistoryItemOfWriteBytes ¶
func (h *Historian) GetHistoryItemOfWriteBytes(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBytesHistoryItem, error)
GetHistoryItemOfWriteBytes returns the data value that was set in the given transaction.
func (*Historian) GetHistoryItemOfWriteIPFSHash ¶
func (h *Historian) GetHistoryItemOfWriteIPFSHash(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIPFSHashHistoryItem, error)
GetHistoryItemOfWriteIPFSHash returns the IPFS hash value that was set in the given transaction.
func (*Historian) GetHistoryItemOfWriteInt ¶
func (h *Historian) GetHistoryItemOfWriteInt(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIntHistoryItem, error)
GetHistoryItemOfWriteInt returns the data value that was set in the given transaction.
func (*Historian) GetHistoryItemOfWriteString ¶
func (h *Historian) GetHistoryItemOfWriteString(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteStringHistoryItem, error)
GetHistoryItemOfWriteString returns the data value that was set in the given transaction.
type Provider ¶
Provider provides the facts
func NewProvider ¶
NewProvider converts session to Provider
func (*Provider) DeleteAddress ¶
func (p *Provider) DeleteAddress(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteAddress deletes address data for the specific key
func (*Provider) DeleteBool ¶
func (p *Provider) DeleteBool(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteBool deletes bool data for the specific key
func (*Provider) DeleteBytes ¶
func (p *Provider) DeleteBytes(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteBytes deletes bytes data for the specific key
func (*Provider) DeleteIPFSHash ¶
func (p *Provider) DeleteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteIPFSHash deletes IPFS hash for the specific key
func (*Provider) DeleteInt ¶
func (p *Provider) DeleteInt(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteInt deletes int data for the specific key
func (*Provider) DeleteString ¶
func (p *Provider) DeleteString(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteString deletes string data for the specific key
func (*Provider) DeleteTxData ¶
func (p *Provider) DeleteTxData(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteTxData deletes tx data for the specific key
func (*Provider) DeleteUint ¶
func (p *Provider) DeleteUint(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error)
DeleteUint deletes uint data for the specific key
func (*Provider) WriteAddress ¶
func (p *Provider) WriteAddress(ctx context.Context, passportAddress common.Address, key [32]byte, data common.Address) (common.Hash, error)
WriteAddress writes data for the specific key (uses Ethereum storage)
func (*Provider) WriteBool ¶
func (p *Provider) WriteBool(ctx context.Context, passportAddress common.Address, key [32]byte, data bool) (common.Hash, error)
WriteBool writes data for the specific key (uses Ethereum storage)
func (*Provider) WriteBytes ¶
func (p *Provider) WriteBytes(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error)
WriteBytes writes data for the specific key (uses Ethereum storage)
func (*Provider) WriteIPFSHash ¶
func (p *Provider) WriteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte, hash string) (common.Hash, error)
WriteIPFSHash writes IPFS hash for specific key (uses Ethereum storage to store the hash)
func (*Provider) WriteInt ¶
func (p *Provider) WriteInt(ctx context.Context, passportAddress common.Address, key [32]byte, data *big.Int) (common.Hash, error)
WriteInt writes data for the specific key (uses Ethereum storage)
func (*Provider) WriteString ¶
func (p *Provider) WriteString(ctx context.Context, passportAddress common.Address, key [32]byte, data string) (common.Hash, error)
WriteString writes data for the specific key (uses Ethereum storage)
type Reader ¶
Reader reads the facts
func (*Reader) ReadAddress ¶
func (r *Reader) ReadAddress(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (common.Address, error)
ReadAddress reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadBool ¶
func (r *Reader) ReadBool(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (bool, error)
ReadBool reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadBytes ¶
func (r *Reader) ReadBytes(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) ([]byte, error)
ReadBytes reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadIPFSHash ¶
func (r *Reader) ReadIPFSHash(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (string, error)
ReadIPFSHash reads the IPFS hash from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadInt ¶
func (r *Reader) ReadInt(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (*big.Int, error)
ReadInt reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadString ¶
func (r *Reader) ReadString(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (string, error)
ReadString reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadTxData ¶
func (r *Reader) ReadTxData(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) ([]byte, error)
ReadTxData reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
func (*Reader) ReadUint ¶
func (r *Reader) ReadUint(ctx context.Context, passport common.Address, factProvider common.Address, key [32]byte) (*big.Int, error)
ReadUint reads the data from the specific key of the given data provider. `ethereum.NotFound` error returned in case no value exists for the given key.
type WriteAddressHistoryItem ¶
type WriteAddressHistoryItem struct { FactProvider common.Address Key [32]byte Data common.Address }
WriteAddressHistoryItem holds parameters of WriteAddress call
type WriteBoolHistoryItem ¶
WriteBoolHistoryItem holds parameters of WriteBool call
type WriteBytesHistoryItem ¶
WriteBytesHistoryItem holds parameters of WriteBytes call
type WriteIPFSHashHistoryItem ¶
WriteIPFSHashHistoryItem holds parameters of WriteIPFSHash call
type WriteIntHistoryItem ¶
WriteIntHistoryItem holds parameters of WriteInt call
type WriteStringHistoryItem ¶
WriteStringHistoryItem holds parameters of WriteString call
type WriteTxDataHistoryItem ¶
WriteTxDataHistoryItem holds parameters of WriteTxData call