Documentation
¶
Index ¶
- Constants
- type AccessControl
- type Committer
- type DataRead
- type DataTx
- func (d *DataTx) AddMustSignUser(userID string)
- func (d *DataTx) Commit(sync bool) (string, error)
- func (d *DataTx) Delete(db string, key string) error
- func (d *DataTx) Get(db string, key string) ([]byte, error)
- func (d *DataTx) Put(db string, key string, bytes []byte, a driver.AccessControl) error
- func (d *DataTx) SignAndClose() ([]byte, error)
- type DataWrite
- type Envelope
- func (e *Envelope) Bytes() ([]byte, error)
- func (e *Envelope) Creator() []byte
- func (e *Envelope) FromBytes(raw []byte) error
- func (e *Envelope) MarshalJSON() ([]byte, error)
- func (e *Envelope) Nonce() []byte
- func (e *Envelope) Results() []byte
- func (e *Envelope) String() string
- func (e *Envelope) TxID() string
- func (e *Envelope) UnmarshalJSON(raw []byte) error
- type EnvelopeService
- type Finality
- type FinalityListener
- type Flag
- type IdentityManager
- type Ledger
- type LoadedTransaction
- func (t *LoadedTransaction) CoSignAndClose() ([]byte, error)
- func (t *LoadedTransaction) Commit() error
- func (t *LoadedTransaction) ID() string
- func (t *LoadedTransaction) MustSignUsers() []string
- func (t *LoadedTransaction) Reads() map[string][]*DataRead
- func (t *LoadedTransaction) SignedUsers() []string
- func (t *LoadedTransaction) Writes() map[string][]*DataWrite
- type MetadataService
- type NetworkService
- func (n *NetworkService) Committer() *Committer
- func (n *NetworkService) EnvelopeService() *EnvelopeService
- func (n *NetworkService) Finality() *Finality
- func (n *NetworkService) IdentityManager() *IdentityManager
- func (n *NetworkService) MetadataService() *MetadataService
- func (n *NetworkService) Name() string
- func (n *NetworkService) ProcessorManager() *ProcessorManager
- func (n *NetworkService) SessionManager() *SessionManager
- func (n *NetworkService) TransactionManager() *TransactionManager
- func (n *NetworkService) Vault() Vault
- type NetworkServiceProvider
- type ProcessTransaction
- type ProcessedTransaction
- type Processor
- type ProcessorManager
- type QueryIterator
- type RWSet
- type Request
- type Session
- type SessionManager
- type SessionQueryExecutor
- type Transaction
- func (d *Transaction) AddMustSignUser(userID string)
- func (d *Transaction) Commit(sync bool) (string, error)
- func (d *Transaction) Delete(db string, key string) error
- func (d *Transaction) Get(db string, key string) ([]byte, error)
- func (d *Transaction) Put(db string, key string, bytes []byte, a AccessControl) error
- func (d *Transaction) SignAndClose() ([]byte, error)
- type TransactionFilter
- type TransactionManager
- func (t *TransactionManager) CommitEnvelope(session *Session, envelope *Envelope) error
- func (t *TransactionManager) ComputeTxID(id *TxID) string
- func (t *TransactionManager) NewEnvelope() *Envelope
- func (t *TransactionManager) NewLoadedTransaction(env []byte, creator string) (*LoadedTransaction, error)
- func (t *TransactionManager) NewTransaction(txID string, creator string) (*Transaction, error)
- func (t *TransactionManager) NewTransactionFromSession(session *Session, txID string) (*Transaction, error)
- type TransientMap
- func (m TransientMap) Exists(key string) bool
- func (m TransientMap) Get(id string) []byte
- func (m TransientMap) GetState(key string, state interface{}) error
- func (m TransientMap) IsEmpty() bool
- func (m TransientMap) Set(key string, raw []byte) error
- func (m TransientMap) SetState(key string, state interface{}) error
- type TxID
- type Vault
Constants ¶
const ( VALID = driver.VALID INVALID_MVCC_CONFLICT_WITHIN_BLOCK INVALID_MVCC_CONFLICT_WITH_COMMITTED_STATE INVALID_DATABASE_DOES_NOT_EXIST INVALID_NO_PERMISSION INVALID_INCORRECT_ENTRIES INVALID_UNAUTHORISED INVALID_MISSING_SIGNATURE )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl = driver.AccessControl
type Committer ¶
type Committer struct {
// contains filtered or unexported fields
}
Committer models the committer service
func NewCommitter ¶
func (*Committer) AddFinalityListener ¶ added in v0.4.0
func (c *Committer) AddFinalityListener(txID string, listener FinalityListener) 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.
func (*Committer) AddTransactionFilter ¶ added in v0.4.0
func (c *Committer) AddTransactionFilter(filter TransactionFilter) 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
func (*Committer) RemoveFinalityListener ¶ added in v0.4.0
func (c *Committer) RemoveFinalityListener(txID string, listener FinalityListener) error
RemoveFinalityListener unregisters the passed listener.
type DataTx ¶ added in v0.4.0
type DataTx struct {
// contains filtered or unexported fields
}
func (*DataTx) AddMustSignUser ¶ added in v0.4.0
func (*DataTx) SignAndClose ¶ added in v0.4.0
type Envelope ¶
type Envelope struct {
// contains filtered or unexported fields
}
func (*Envelope) MarshalJSON ¶
func (*Envelope) UnmarshalJSON ¶
type EnvelopeService ¶
type EnvelopeService struct {
// contains filtered or unexported fields
}
func (*EnvelopeService) Exists ¶
func (e *EnvelopeService) Exists(txid string) bool
func (*EnvelopeService) LoadEnvelope ¶
func (e *EnvelopeService) LoadEnvelope(txid string) ([]byte, error)
func (*EnvelopeService) StoreEnvelope ¶
func (e *EnvelopeService) StoreEnvelope(txid string, env interface{}) error
type FinalityListener ¶ added in v0.4.0
type FinalityListener = driver.FinalityListener
FinalityListener is the interface that must be implemented to receive transaction status change notifications
type IdentityManager ¶
type IdentityManager struct {
// contains filtered or unexported fields
}
func (*IdentityManager) Me ¶
func (im *IdentityManager) Me() string
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func (*Ledger) GetTransactionByID ¶
func (l *Ledger) GetTransactionByID(txID string) (*ProcessedTransaction, error)
type LoadedTransaction ¶
type LoadedTransaction struct {
// contains filtered or unexported fields
}
func (*LoadedTransaction) CoSignAndClose ¶
func (t *LoadedTransaction) CoSignAndClose() ([]byte, error)
func (*LoadedTransaction) Commit ¶
func (t *LoadedTransaction) Commit() error
func (*LoadedTransaction) ID ¶
func (t *LoadedTransaction) ID() string
func (*LoadedTransaction) MustSignUsers ¶
func (t *LoadedTransaction) MustSignUsers() []string
func (*LoadedTransaction) Reads ¶
func (t *LoadedTransaction) Reads() map[string][]*DataRead
func (*LoadedTransaction) SignedUsers ¶
func (t *LoadedTransaction) SignedUsers() []string
func (*LoadedTransaction) Writes ¶
func (t *LoadedTransaction) Writes() map[string][]*DataWrite
type MetadataService ¶
type MetadataService struct {
// contains filtered or unexported fields
}
func (*MetadataService) Exists ¶
func (m *MetadataService) Exists(txid string) bool
func (*MetadataService) LoadTransient ¶
func (m *MetadataService) LoadTransient(txid string) (TransientMap, error)
func (*MetadataService) StoreTransient ¶
func (m *MetadataService) StoreTransient(txid string, transientMap TransientMap) error
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
NetworkService models an Orion network
func GetDefaultONS ¶
func GetDefaultONS(sp view2.ServiceProvider) (*NetworkService, error)
GetDefaultONS returns the default Orion Network Service
func GetOrionNetworkService ¶
func GetOrionNetworkService(sp view2.ServiceProvider, id string) (*NetworkService, error)
GetOrionNetworkService returns the Orion Network Service for the passed id, nil if not found
func NewNetworkService ¶
func NewNetworkService(ons driver.OrionNetworkService, name string) *NetworkService
func (*NetworkService) Committer ¶
func (n *NetworkService) Committer() *Committer
Committer returns the committer service
func (*NetworkService) EnvelopeService ¶
func (n *NetworkService) EnvelopeService() *EnvelopeService
func (*NetworkService) Finality ¶
func (n *NetworkService) Finality() *Finality
func (*NetworkService) IdentityManager ¶
func (n *NetworkService) IdentityManager() *IdentityManager
func (*NetworkService) MetadataService ¶
func (n *NetworkService) MetadataService() *MetadataService
func (*NetworkService) ProcessorManager ¶
func (n *NetworkService) ProcessorManager() *ProcessorManager
ProcessorManager returns the processor manager of this network
func (*NetworkService) SessionManager ¶
func (n *NetworkService) SessionManager() *SessionManager
func (*NetworkService) TransactionManager ¶
func (n *NetworkService) TransactionManager() *TransactionManager
TransactionManager returns the transaction manager of this network
func (*NetworkService) Vault ¶
func (n *NetworkService) Vault() Vault
type NetworkServiceProvider ¶
type NetworkServiceProvider struct {
// contains filtered or unexported fields
}
func GetNetworkServiceProvider ¶
func GetNetworkServiceProvider(sp view2.ServiceProvider) (*NetworkServiceProvider, error)
func NewNetworkServiceProvider ¶
func NewNetworkServiceProvider(onsProvider driver.OrionNetworkServiceProvider) *NetworkServiceProvider
func (*NetworkServiceProvider) NetworkService ¶
func (nsp *NetworkServiceProvider) NetworkService(id string) (*NetworkService, error)
type ProcessTransaction ¶
type ProcessedTransaction ¶
type ProcessedTransaction struct {
// contains filtered or unexported fields
}
ProcessedTransaction models a transaction that has been processed by Fabric
func (*ProcessedTransaction) TxID ¶
func (pt *ProcessedTransaction) TxID() string
TxID returns the transaction's id
func (*ProcessedTransaction) ValidationCode ¶
func (pt *ProcessedTransaction) ValidationCode() Flag
ValidationCode returns the transaction's validation code
type Processor ¶
type Processor interface {
Process(req Request, tx ProcessTransaction, rws *RWSet, ns string) error
}
type ProcessorManager ¶
type ProcessorManager struct {
// contains filtered or unexported fields
}
func (*ProcessorManager) AddProcessor ¶
func (pm *ProcessorManager) AddProcessor(ns string, p Processor) error
func (*ProcessorManager) SetDefaultProcessor ¶
func (pm *ProcessorManager) SetDefaultProcessor(p Processor) error
type QueryIterator ¶
type QueryIterator struct {
// contains filtered or unexported fields
}
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) QueryExecutor ¶
func (s *Session) QueryExecutor(db string) (*SessionQueryExecutor, error)
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager is a session manager that allows the developer to access orion directly
func (*SessionManager) NewSession ¶
func (sm *SessionManager) NewSession(id string) (*Session, error)
NewSession creates a new session to orion using the passed identity
type SessionQueryExecutor ¶
type SessionQueryExecutor struct {
// contains filtered or unexported fields
}
func (*SessionQueryExecutor) GetDataByRange ¶
func (d *SessionQueryExecutor) GetDataByRange(startKey, endKey string, limit uint64) (*QueryIterator, error)
GetDataByRange executes a range query. 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.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) AddMustSignUser ¶
func (d *Transaction) AddMustSignUser(userID string)
func (*Transaction) Put ¶
func (d *Transaction) Put(db string, key string, bytes []byte, a AccessControl) error
func (*Transaction) SignAndClose ¶
func (d *Transaction) SignAndClose() ([]byte, 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 TransactionManager struct {
// contains filtered or unexported fields
}
func (*TransactionManager) CommitEnvelope ¶
func (t *TransactionManager) CommitEnvelope(session *Session, envelope *Envelope) error
func (*TransactionManager) ComputeTxID ¶
func (t *TransactionManager) ComputeTxID(id *TxID) string
func (*TransactionManager) NewEnvelope ¶
func (t *TransactionManager) NewEnvelope() *Envelope
func (*TransactionManager) NewLoadedTransaction ¶
func (t *TransactionManager) NewLoadedTransaction(env []byte, creator string) (*LoadedTransaction, error)
func (*TransactionManager) NewTransaction ¶
func (t *TransactionManager) NewTransaction(txID string, creator string) (*Transaction, error)
func (*TransactionManager) NewTransactionFromSession ¶ added in v0.4.0
func (t *TransactionManager) NewTransactionFromSession(session *Session, txID string) (*Transaction, error)
type TransientMap ¶
func (TransientMap) Exists ¶
func (m TransientMap) Exists(key string) bool
func (TransientMap) Get ¶
func (m TransientMap) Get(id string) []byte
func (TransientMap) GetState ¶
func (m TransientMap) GetState(key string, state interface{}) error
func (TransientMap) IsEmpty ¶
func (m TransientMap) IsEmpty() bool
func (TransientMap) SetState ¶
func (m TransientMap) SetState(key string, state interface{}) error
type Vault ¶
type Vault interface { StoreEnvelope(id string, env interface{}) error StoreTransaction(id string, raw []byte) error StoreTransient(id string, tm driver.TransientMap) error Status(txID string) (driver.ValidationCode, string, error) DiscardTx(txID string, message string) error GetLastTxID() (string, error) NewRWSet(txid string) (*RWSet, error) GetRWSet(id string, results []byte) (*RWSet, error) CommitTX(ctx context.Context, txid string, block driver.BlockNum, indexInBloc driver.TxNum) error }