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 BuildLegacyPluginArgs(names []string) (ns []string)
- func CloseLedger(handle int) ctx.Channel
- func ConvertPluginArgs(poolName string) []string
- 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(tx plugin.TxInfo, ID string) (string, string, error)
- func RegisterPlugin(name string, plugin plugin.Ledger)
- func SetProtocolVersion(version uint64) ctx.Channel
- func Write(tx plugin.TxInfo, ID, data string) (err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLegacyPluginArgs ¶ added in v0.3.5
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 ConvertPluginArgs ¶ added in v0.3.5
ConvertPluginArgs converts pool name to list of config pairs if it's possible
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 plugin name-argument pairs. ListPlugins() returns all of the available ones.
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().