Documentation
¶
Index ¶
- type AccessControl
- type BlockNum
- type ByNum
- type Committer
- type DataRead
- type DataTx
- type DataWrite
- type DeliveryService
- type Envelope
- type EnvelopeService
- type Finality
- type FinalityListener
- type Flag
- type GetStateOpt
- type Identity
- type IdentityManager
- type Ledger
- type ListenerManager
- type ListenerManagerProvider
- type LoadedDataTx
- type MetadataService
- type NetworkConfig
- type NetworkConfigProvider
- type OrionNetworkService
- type OrionNetworkServiceProvider
- type ProcessTransaction
- type Processor
- type ProcessorManager
- type Query
- type QueryExecutor
- type QueryIterator
- type RWSExtractor
- type RWSet
- type Request
- type SeekEnd
- type SeekPos
- type SeekStart
- type Session
- type SessionManager
- type StatusReporter
- type TXIDStore
- type TransactionFilter
- type TransactionManager
- type TransactionService
- type TransactionStatusChanged
- type TransientMap
- type TxID
- type TxNum
- type TxValidationStatus
- type TxidIterator
- type ValidationCode
- type ValidationCodeProvider
- func (p *ValidationCodeProvider) Busy() ValidationCode
- func (p *ValidationCodeProvider) FromInt32(code int32) ValidationCode
- func (p *ValidationCodeProvider) Invalid() ValidationCode
- func (p *ValidationCodeProvider) NotFound() ValidationCode
- func (p *ValidationCodeProvider) ToInt32(code ValidationCode) int32
- func (p *ValidationCodeProvider) Unknown() ValidationCode
- func (p *ValidationCodeProvider) Valid() ValidationCode
- type Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl = interface{}
type ByNum ¶
type ByNum struct {
Txid string
Code ValidationCode
}
type Committer ¶
type Committer interface {
Start(context context.Context) error
// AddTransactionFilter adds a new transaction filter to this commit pipeline.
// The transaction filter is used to check if an unknown transaction needs to be processed anyway
AddTransactionFilter(tf TransactionFilter) error
// AddFinalityListener registers a listener for transaction status for the passed transaction id.
// If the status is already valid or invalid, the listener is called immediately.
// When the listener is invoked, then it is also removed.
// The transaction id must not be empty.
AddFinalityListener(txID string, listener FinalityListener) error
// RemoveFinalityListener unregisters the passed listener.
RemoveFinalityListener(txID string, listener FinalityListener) error
}
Committer models the committer service
type DeliveryService ¶
type DeliveryService interface {
// StartDelivery starts the delivery
StartDelivery(context.Context) error
// Stop stops delivery
Stop()
}
DeliveryService models the delivery service
type EnvelopeService ¶
type FinalityListener ¶ added in v0.4.0
type FinalityListener = driver.FinalityListener[ValidationCode]
FinalityListener is the interface that must be implemented to receive transaction status change notifications
type GetStateOpt ¶
type GetStateOpt = driver.GetStateOpt
type IdentityManager ¶
type ListenerManager ¶ added in v0.4.0
type ListenerManager driver.ListenerManager[ValidationCode]
type ListenerManagerProvider ¶ added in v0.4.0
type ListenerManagerProvider driver.ListenerManagerProvider[ValidationCode]
type LoadedDataTx ¶
type MetadataService ¶
type MetadataService interface {
Exists(txid string) bool
StoreTransient(txid string, transientMap TransientMap) error
LoadTransient(txid string) (TransientMap, error)
}
type NetworkConfig ¶ added in v0.4.0
type NetworkConfigProvider ¶ added in v0.4.0
type NetworkConfigProvider interface {
GetNetworkConfig(network string) (NetworkConfig, error)
}
type OrionNetworkService ¶
type OrionNetworkService interface {
Name() string
IdentityManager() IdentityManager
SessionManager() SessionManager
TransactionManager() TransactionManager
TransactionService() TransactionService
MetadataService() MetadataService
Vault() Vault
EnvelopeService() EnvelopeService
ProcessorManager() ProcessorManager
Finality() Finality
Committer() Committer
DeliveryService() DeliveryService
}
OrionNetworkService gives access to a Orion network components
type OrionNetworkServiceProvider ¶
type OrionNetworkServiceProvider interface {
Names() []string
DefaultName() string
// OrionNetworkService returns a OrionNetworkService instance for the passed parameters
OrionNetworkService(id string) (OrionNetworkService, error)
}
func GetOrionNetworkServiceProvider ¶
func GetOrionNetworkServiceProvider(ctx view2.ServiceProvider) OrionNetworkServiceProvider
type ProcessTransaction ¶
type Processor ¶
type Processor interface {
Process(req Request, tx ProcessTransaction, rws RWSet, ns string) error
}
type ProcessorManager ¶
type Query ¶
type Query interface {
// GetDataByRange executes a range query on a given database. The startKey is
// inclusive but endKey is not. When the startKey is an empty string, it denotes
// `fetch keys from the beginning` while an empty endKey denotes `fetch keys till the
// the end`. The limit denotes the number of records to be fetched in total. However,
// when the limit is set to 0, it denotes no limit. The iterator returned by
// GetDataByRange is used to retrieve the records.
GetDataByRange(dbName, startKey, endKey string, limit uint64) (QueryIterator, error)
}
Query allows the developer to perform queries over the orion database
type QueryExecutor ¶
type QueryExecutor = vault.QueryExecutor
type QueryIterator ¶
type QueryIterator interface {
// Next returns the next record. If there is no more records, it would return a nil value
// and a false value.
Next() (string, []byte, uint64, uint64, bool, error)
}
QueryIterator is an iterator over the results of a query
type RWSExtractor ¶
type RWSExtractor interface {
Extract(tx []byte) (ProcessTransaction, RWSet, error)
}
type Session ¶
type Session interface {
// DataTx returns a data transaction for the passed id
DataTx(txID string) (DataTx, error)
LoadDataTx(env interface{}) (LoadedDataTx, error)
Ledger() (Ledger, error)
Query() (Query, error)
}
Session let the developer access orion Any implementation must be thread-safe
type SessionManager ¶
type SessionManager interface {
// NewSession creates a new session to orion using the passed identity
NewSession(id string) (Session, error)
}
SessionManager is a session manager that allows the developer to access orion directly
type StatusReporter ¶ added in v0.4.0
type StatusReporter interface {
Status(txID string) (ValidationCode, string, []string, error)
}
type TXIDStore ¶
type TXIDStore interface {
GetLastTxID() (string, error)
Iterator(pos interface{}) (TxidIterator, error)
}
type TransactionFilter ¶ added in v0.4.0
type TransactionFilter = driver.TransactionFilter
TransactionFilter is used to filter unknown transactions. If the filter accepts, the transaction is processed by the commit pipeline anyway.
type TransactionManager ¶
type TransactionService ¶
type TransactionStatusChanged ¶
type TransactionStatusChanged struct {
ThisTopic string
TxID string
VC ValidationCode
ValidationMessage string
}
TransactionStatusChanged is the message sent when the status of a transaction changes
func (*TransactionStatusChanged) Message ¶
func (t *TransactionStatusChanged) Message() interface{}
Message returns the message itself
func (*TransactionStatusChanged) Topic ¶
func (t *TransactionStatusChanged) Topic() string
Topic returns the topic for the message
type TransientMap ¶
type TxValidationStatus ¶ added in v0.4.0
type TxValidationStatus = driver2.TxValidationStatus[ValidationCode]
type TxidIterator ¶
type TxidIterator = collections.Iterator[*ByNum]
type ValidationCode ¶
type ValidationCode = int
const ( Valid ValidationCode // Transaction is valid and committed Invalid // Transaction is invalid and has been discarded Busy // Transaction does not yet have a validity state Unknown // Transaction is unknown )
type ValidationCodeProvider ¶ added in v0.4.0
type ValidationCodeProvider struct{}
func (*ValidationCodeProvider) Busy ¶ added in v0.4.0
func (p *ValidationCodeProvider) Busy() ValidationCode
func (*ValidationCodeProvider) FromInt32 ¶ added in v0.4.0
func (p *ValidationCodeProvider) FromInt32(code int32) ValidationCode
func (*ValidationCodeProvider) Invalid ¶ added in v0.4.0
func (p *ValidationCodeProvider) Invalid() ValidationCode
func (*ValidationCodeProvider) NotFound ¶ added in v0.4.0
func (p *ValidationCodeProvider) NotFound() ValidationCode
func (*ValidationCodeProvider) ToInt32 ¶ added in v0.4.0
func (p *ValidationCodeProvider) ToInt32(code ValidationCode) int32
func (*ValidationCodeProvider) Unknown ¶ added in v0.4.0
func (p *ValidationCodeProvider) Unknown() ValidationCode
func (*ValidationCodeProvider) Valid ¶ added in v0.4.0
func (p *ValidationCodeProvider) Valid() ValidationCode