Documentation ¶
Index ¶
- Variables
- func With(db db.DB, fn func(db *Model) error) error
- type Accounts
- func (c *Accounts) Book(url *url.URL) *AccountsBook
- func (c *Accounts) Books() values.Set[*url.URL]
- func (c *Accounts) Commit() error
- func (c *Accounts) IsDirty() bool
- func (c *Accounts) Key() *record.Key
- func (c *Accounts) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (c *Accounts) Tokens() values.Set[*url.URL]
- func (c *Accounts) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type AccountsBook
- func (c *AccountsBook) Commit() error
- func (c *AccountsBook) IsDirty() bool
- func (c *AccountsBook) Key() *record.Key
- func (c *AccountsBook) Pages() values.List[*protocol.KeyPage]
- func (c *AccountsBook) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (c *AccountsBook) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type Address
- func (a *Address) AddLabel(s string)
- func (v *Address) Copy() *Address
- func (v *Address) CopyAsInterface() interface{}
- func (v *Address) Equal(u *Address) bool
- func (a *Address) Hash() []byte
- func (v *Address) IsValid() error
- func (a *Address) LiteIdentity() *url.URL
- func (v *Address) MarshalBinary() ([]byte, error)
- func (v *Address) MarshalJSON() ([]byte, error)
- func (a *Address) RemoveLabel(s string)
- func (v *Address) UnmarshalBinary(data []byte) error
- func (v *Address) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Address) UnmarshalJSON(b []byte) error
- type Config
- func (c *Config) Commit() error
- func (c *Config) IsDirty() bool
- func (c *Config) Key() *record.Key
- func (c *Config) Magic() magicValue
- func (c *Config) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (c *Config) Salt() values.Value[[]byte]
- func (c *Config) Version() values.Value[[]byte]
- func (c *Config) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type Enclave
- func (e *Enclave) CopyAsInterface() any
- func (e *Enclave) Equal(f *Enclave) bool
- func (e *Enclave) MarshalBinary() ([]byte, error)
- func (e *Enclave) MarshalJSON() ([]byte, error)
- func (e *Enclave) UnmarshalBinary(b []byte) error
- func (e *Enclave) UnmarshalBinaryFrom(rd io.Reader) error
- func (e *Enclave) UnmarshalJSON(b []byte) error
- type Lookup
- func (c *Lookup) ByLabel(value string) values.Value[*url.URL]
- func (c *Lookup) ByPublicKey(value string) values.Value[*url.URL]
- func (c *Lookup) Commit() error
- func (c *Lookup) IsDirty() bool
- func (c *Lookup) Key() *record.Key
- func (c *Lookup) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (c *Lookup) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type Model
- func (c *Model) Accounts() *Accounts
- func (c *Model) Address(lite *url.URL) values.Value[*Address]
- func (m *Model) AddressByHash(hash []byte) values.Value[*Address]
- func (m *Model) AddressByLabel(label string) values.Value[*Address]
- func (m *Model) AddressByPublicKey(pubKey []byte) values.Value[*Address]
- func (m *Model) Addresses() []values.Value[*Address]
- func (m *Model) AsEncrypted(key *memguard.Enclave) *Model
- func (c *Model) Commit() error
- func (c *Model) Config() *Config
- func (m *Model) Decrypt(key *memguard.Enclave) (*Model, error)
- func (c *Model) IsDirty() bool
- func (c *Model) Key() *record.Key
- func (c *Model) Multi() *Multi
- func (m *Model) PrivateKey(lite *url.URL) *PrivateKey
- func (c *Model) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (m *Model) Unwrap() db.DB
- func (c *Model) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type Multi
- func (c *Multi) Commit() error
- func (c *Multi) Enabled() values.Value[bool]
- func (c *Multi) IsDirty() bool
- func (c *Multi) Key() *record.Key
- func (c *Multi) Names() values.Set[string]
- func (c *Multi) Resolve(key *record.Key) (record.Record, *record.Key, error)
- func (c *Multi) Salt() values.Value[[32]byte]
- func (c *Multi) Vault(name string) values.Value[*api.VaultInfo]
- func (c *Multi) Walk(opts record.WalkOptions, fn record.WalkFunc) error
- type PrivateKey
Constants ¶
This section is empty.
Variables ¶
var Version = db.NewVersion(0, 0, 5, 0)
Version is incremented whenever a bucket format is changed.
Functions ¶
Types ¶
type Accounts ¶
type Accounts struct {
// contains filtered or unexported fields
}
type AccountsBook ¶
type AccountsBook struct {
// contains filtered or unexported fields
}
func (*AccountsBook) Commit ¶
func (c *AccountsBook) Commit() error
func (*AccountsBook) IsDirty ¶
func (c *AccountsBook) IsDirty() bool
func (*AccountsBook) Key ¶
func (c *AccountsBook) Key() *record.Key
func (*AccountsBook) Walk ¶
func (c *AccountsBook) Walk(opts record.WalkOptions, fn record.WalkFunc) error
type Address ¶
type Address struct { Labels []string `json:"labels,omitempty" form:"labels" query:"labels" validate:"required"` Type protocol.SignatureType `json:"type,omitempty" form:"type" query:"type" validate:"required"` Derivation string `json:"derivation,omitempty" form:"derivation" query:"derivation" validate:"required"` WalletId *url.URL `json:"walletId,omitempty" form:"walletId" query:"walletId" validate:"required"` PublicKey []byte `json:"publicKey,omitempty" form:"publicKey" query:"publicKey" validate:"required"` LastUsedOn uint64 `json:"lastUsedOn,omitempty" form:"lastUsedOn" query:"lastUsedOn" validate:"required"` // contains filtered or unexported fields }
func (*Address) CopyAsInterface ¶
func (v *Address) CopyAsInterface() interface{}
func (*Address) LiteIdentity ¶
func (*Address) MarshalBinary ¶
func (*Address) MarshalJSON ¶
func (*Address) RemoveLabel ¶
func (*Address) UnmarshalBinary ¶
func (*Address) UnmarshalJSON ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
type Enclave ¶
func NewEnclave ¶
func (*Enclave) CopyAsInterface ¶
CopyAsInterface does nothing as Enclave is immutable so there's no need to copy.
func (*Enclave) MarshalBinary ¶
func (*Enclave) MarshalJSON ¶
func (*Enclave) UnmarshalBinary ¶
func (*Enclave) UnmarshalJSON ¶
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) AddressByPublicKey ¶
func (*Model) AsEncrypted ¶ added in v0.6.0
AsEncrypted returns a new model using the given key for encryption.
func (*Model) PrivateKey ¶
func (m *Model) PrivateKey(lite *url.URL) *PrivateKey
type Multi ¶
type Multi struct {
// contains filtered or unexported fields
}
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func (*PrivateKey) Get ¶
func (p *PrivateKey) Get() (*memguard.LockedBuffer, error)
Get loads the contents of the enclave as a locked buffer. The buffer must be destroyed once it is no longer needed.
func (*PrivateKey) GetCopy ¶
GetCopy loads, unlocks, and copies the contents of the enclave. The value must be wiped once it is no longer needed. GetCopy *does not* guarantee constant-time.
func (*PrivateKey) Put ¶
Put creates an enclave with the buffer and stores it. The original buffer is wiped.
func (*PrivateKey) PutCopy ¶
PutCopy creates an enclave with a copy of the buffer and stores it. The original buffer is not modified.
func (*PrivateKey) PutLocked ¶
func (p *PrivateKey) PutLocked(b *memguard.LockedBuffer) error
PutLocked creates an enclave from the locked buffer and stores it. The buffer is wiped and destroyed.