Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶ added in v0.9.3
func InitConfig()
func NewManagedTransactionEventHandler ¶ added in v1.2.4
func NewManagedTransactionEventHandler(ctx context.Context, cm confirmations.Manager, ws ws.WebSocketServer, th txhandler.TransactionHandler) txhandler.ManagedTxEventHandler
Types ¶
type ManagedTransactionEventHandler ¶ added in v1.2.4
type ManagedTransactionEventHandler struct {
Ctx context.Context
ConfirmationManager confirmations.Manager
WsServer ws.WebSocketServer
TxHandler txhandler.TransactionHandler
}
func (*ManagedTransactionEventHandler) HandleEvent ¶ added in v1.2.4
func (eh *ManagedTransactionEventHandler) HandleEvent(_ context.Context, e apitypes.ManagedTransactionEvent) error
type Manager ¶ added in v0.9.3
type Manager interface {
Start() error
Close()
APIRouter() *mux.Router
// API managed event streams have checkpoints stored externally.
// Events are access by calling PollAPIMangedStream() on the returned stream.
// - The spec must have a name, but no UUID or type.
// - The name must be unique to managed API streams (separate namespace to persisted ones)
// - Multiple calls with the same ID will return the same object.
// - Use "isNew" to determine if the event stream was freshly initialized from the listener array
// - If not freshly initialized, the listeners array ignored (you can choose to do check the existing listener list yourself)
//
// Checkpoints are commonly tied to individual listeners, so it is critical that the caller manages
// deterministically the IDs of the listeners passed in. They cannot be empty (an error will be returned)
GetAPIManagedEventStream(spec *apitypes.EventStream, listeners []*apitypes.Listener) (isNew bool, es eventapi.EventStream, err error)
// Resources will be used by the stream in the background, so if your object is deleted
// then this function should be called to clean-up any in-memory state (if there is any
// possibility you previously called GetAPIManagedEventStream)
CleanupAPIManagedEventStream(name string) error
// Access directly to the transaction completions polling interface, which allows blocking-polling interactions with an
// ordered stream of transaction completions
TransactionCompletions() txhandler.TransactionCompletions
// Ability to query a transaction by ID to get full status
GetTransactionByIDWithStatus(ctx context.Context, txID string, withHistory bool) (transaction *apitypes.TXWithStatus, err error)
// Ability to reconcile confirmations for a transaction
// This function uses the single in-memory canonical chain to check and build the confirmation map of a given transaction hash
ReconcileConfirmationsForTransaction(ctx context.Context, txHash string, existingConfirmations []*ffcapi.MinimalBlockInfo, targetConfirmationCount uint64) (*ffcapi.ConfirmationUpdateResult, error)
// Ability to submit new transactions into the transaction handler for management/submission
TransactionHandler() txhandler.TransactionHandler
}
Source Files
¶
- address_management.go
- api.go
- gas_management.go
- manager.go
- route__root_command.go
- route_delete_eventstream.go
- route_delete_eventstream_listener.go
- route_delete_subscription.go
- route_delete_transaction.go
- route_get_address_balance.go
- route_get_eventstream.go
- route_get_eventstream_listener.go
- route_get_eventstream_listeners.go
- route_get_eventstreams.go
- route_get_gas_price.go
- route_get_status_live.go
- route_get_status_ready.go
- route_get_subscription.go
- route_get_subscriptions.go
- route_get_transaction.go
- route_get_transaction_confirmations.go
- route_get_transaction_history.go
- route_get_transaction_receipt.go
- route_get_transactions.go
- route_patch_eventstream.go
- route_patch_eventstream_listener.go
- route_patch_subscription.go
- route_patch_transaction.go
- route_post_eventstream.go
- route_post_eventstream_listener_reset.go
- route_post_eventstream_listeners.go
- route_post_eventstream_resume.go
- route_post_eventstream_suspend.go
- route_post_subscription_reset.go
- route_post_subscriptions.go
- route_post_transaction_resume.go
- route_post_transaction_suspend.go
- routes.go
- status_management.go
- stream_management.go
- transaction_events_handler.go
- transaction_management.go
Click to show internal directories.
Click to hide internal directories.