Documentation
¶
Overview ¶
Package pool is corresponding Go package for libindy's pool namespace. We suggest that you read indy SDK documentation for more information.
Pool offers functions to manage ledger pools. The Go wrapper has extended pool system which means that it supports ledger plugins to implement own persistent storage. These additional ledger can be used all at the same time:
select { case r = <-pool.OpenLedger(poolName, "FINDY_MEM_LEDGER"): if r.Err() != nil { log.Panicln("Cannot open pool") } case <-time.After(maxTimeout): log.Panicln("Timeout exceeded") } h := r.Handle()
Current implementation offers a memory ledger for tests and simple cache. The interface to use them is an extension to OpenLedger function which takes multiple ledger pool names at once.
Index ¶
- func CloseLedger(handle int) ctx.Channel
- func CreateConfig(name string, config Config) ctx.Channel
- func IsIndyLedgerOpen(handle int) bool
- func List() ctx.Channel
- func ListPlugins() []string
- func OpenLedger(names ...string) ctx.Channel
- func Read(ID string) (string, string, error)
- func RegisterPlugin(name string, plugin plugin.Ledger)
- func SetProtocolVersion(version uint64) ctx.Channel
- func Write(ID, data string)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseLedger ¶
CloseLedger is exchanged indy SDK wrapper function. It closes all currently opened ledger plugins and the actual indy ledger if it is open as well.
func CreateConfig ¶
CreateConfig is indy SDK wrapper to create ledger pool configuration. See more information from indy_pool_create_config().
func IsIndyLedgerOpen ¶
IsIndyLedgerOpen return true if indy ledger is open as well. It is used to coordinate ledger transactions.
func List ¶
List is indy SDK wrapper to list current pool configurations on the host. See more information from indy_pool_list().
func ListPlugins ¶
func ListPlugins() []string
ListPlugins is ledger plugin system function. With the function caller can have list of all currently installed and activated ledger plugins in the compilation.
func OpenLedger ¶
OpenLedger opens all ledger types given. The original indy SDK function takes only one pool configuration name as an argument. This wrapper takes many pool names where one can be an original indy pool and the rest can be any of the plugins compiled into the binary running. ListPlugins() returns all of the available ones.
func Read ¶
Read reads data from all of the plugin ledgers. Note! The original indy ledger is not one of the plugin ledgers, at least not yet.
func RegisterPlugin ¶
RegisterPlugin is interface for ledger plugins to register them selves.
func SetProtocolVersion ¶
SetProtocolVersion is indy SDK wrapper. It sets the used protocol version. In most cases it is 2. See more information from indy_set_protocol_version().