Documentation ¶
Index ¶
Constants ¶
View Source
const ( // An event relative to transactions Tx ResourceType = "tx" // An event relative to transactions in the transaction pool TxPool = "txpool" // An event relative to accounts (creation, update) Acc = "acc" )
View Source
const ( // All events related to the `ResourceType` All KeyType = "*" // "Identifier" of the item // Hash for a Transaction, address for an Account. Identifier = "identifier" // Tx/TxPool only: Transactions with a specified source Source = "source" // Tx/TxPool only: Transactions with a specified target Target = "target" )
Variables ¶
View Source
var ResourceObserver = observable.New()
View Source
var SyncBlockWaitObserver = observable.New()
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { // Affected ressource Resource ResourceType `json:"resource"` // Filter to use (can be `All) Key KeyType `json:"key"` // If `Key != All`, value of the filter Value string `json:"value"` }
A Condition can be sent as the body when calling subscribe
func NewCondition ¶
func NewCondition(resource ResourceType, key KeyType, v ...string) Condition
Instantiate a new `Condition` object
Params:
ressource = The requested `RessourceType` to stream key = The key to stream v = An optional value for key. Only the first value will be used.
Returns: A `Condition` object, that can be triggered or passed to `/subscribe`
Click to show internal directories.
Click to hide internal directories.