db

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func (r *WalletRegistry) GetWalletID(ctx context.Context, identity driver.Identity) (string, error)

GetWalletID returns the wallet identifier bound to the passed identity

func (*WalletRegistry) Lookup

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

func (r *WalletRegistry) RegisterWallet(ctx context.Context, id string, w driver.Wallet) error

RegisterWallet binds the passed wallet to the passed id

func (*WalletRegistry) WalletIDs

func (r *WalletRegistry) WalletIDs(ctx context.Context) ([]string, error)

WalletIDs returns the list of wallet identifiers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL