Documentation
¶
Index ¶
- type WalletRegistry
- func (r *WalletRegistry) BindIdentity(ctx context.Context, identity driver.Identity, eID string, wID string, ...) error
- func (r *WalletRegistry) ContainsIdentity(ctx context.Context, identity driver.Identity, wID string) bool
- func (r *WalletRegistry) GetIdentityMetadata(ctx context.Context, identity driver.Identity, wID string, meta any) error
- func (r *WalletRegistry) GetWalletID(ctx context.Context, identity driver.Identity) (string, error)
- func (r *WalletRegistry) Lookup(ctx context.Context, id driver.WalletLookupID) (driver.Wallet, idriver.IdentityInfo, string, error)
- func (r *WalletRegistry) RegisterIdentity(ctx context.Context, config driver.IdentityConfiguration) error
- func (r *WalletRegistry) RegisterWallet(ctx context.Context, id string, w driver.Wallet) error
- func (r *WalletRegistry) WalletIDs(ctx context.Context) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WalletRegistry ¶
type WalletRegistry struct { Logger logging.Logger Role identity.Role Storage idriver.WalletStoreService Wallets map[string]driver.Wallet }
WalletRegistry manages wallets whose long-term identities have a given role.
func NewWalletRegistry ¶
func NewWalletRegistry(logger logging.Logger, role identity.Role, storage idriver.WalletStoreService) *WalletRegistry
NewWalletRegistry returns a new registry for the passed parameters. A registry is bound to a given role, and it is persistent. Long-term identities are provided by the passed identity provider
func (*WalletRegistry) BindIdentity ¶
func (r *WalletRegistry) BindIdentity(ctx context.Context, identity driver.Identity, eID string, wID string, meta any) error
BindIdentity binds the passed identity to the passed wallet identifier. Additional metadata can be bound to the identity.
func (*WalletRegistry) ContainsIdentity ¶
func (r *WalletRegistry) ContainsIdentity(ctx context.Context, identity driver.Identity, wID string) bool
ContainsIdentity returns true if the passed identity belongs to the passed wallet, false otherwise
func (*WalletRegistry) GetIdentityMetadata ¶
func (r *WalletRegistry) GetIdentityMetadata(ctx context.Context, identity driver.Identity, wID string, meta any) error
GetIdentityMetadata loads metadata bound to the passed identity into the passed meta argument
func (*WalletRegistry) GetWalletID ¶
GetWalletID returns the wallet identifier bound to the passed identity
func (*WalletRegistry) Lookup ¶
func (r *WalletRegistry) Lookup(ctx context.Context, id driver.WalletLookupID) (driver.Wallet, idriver.IdentityInfo, string, error)
Lookup searches the wallet corresponding to the passed id. If a wallet is found, Lookup returns the wallet and its identifier. If no wallet is found, Lookup returns the identity info and a potential wallet identifier for the passed id, if anything is found
func (*WalletRegistry) RegisterIdentity ¶
func (r *WalletRegistry) RegisterIdentity(ctx context.Context, config driver.IdentityConfiguration) error
func (*WalletRegistry) RegisterWallet ¶
RegisterWallet binds the passed wallet to the passed id