multiaccounts

package
v0.179.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name                    string                    `json:"name"`
	Timestamp               int64                     `json:"timestamp"`
	Identicon               string                    `json:"identicon"`
	ColorHash               ColorHash                 `json:"colorHash"`
	ColorID                 int64                     `json:"colorId"`
	CustomizationColor      common.CustomizationColor `json:"customizationColor,omitempty"`
	KeycardPairing          string                    `json:"keycard-pairing"`
	KeyUID                  string                    `json:"key-uid"`
	Images                  []images.IdentityImage    `json:"images"`
	KDFIterations           int                       `json:"kdfIterations,omitempty"`
	CustomizationColorClock uint64                    `json:"-"`
}

Account stores public information about account.

func (*Account) FromProtobuf added in v0.106.1

func (a *Account) FromProtobuf(ma *protobuf.MultiAccount)

func (*Account) GetCustomizationColor added in v0.179.0

func (a *Account) GetCustomizationColor() common.CustomizationColor

func (*Account) GetCustomizationColorID added in v0.179.0

func (a *Account) GetCustomizationColorID() uint32

func (*Account) RefersToKeycard added in v0.176.3

func (a *Account) RefersToKeycard() bool

func (*Account) ToProtobuf added in v0.106.1

func (a *Account) ToProtobuf() *protobuf.MultiAccount

type ColorHash added in v0.140.1

type ColorHash [][2]int

type Database

type Database struct {
	// contains filtered or unexported fields
}

func InitializeDB

func InitializeDB(path string) (*Database, error)

InitializeDB creates db file at a given path and applies migrations.

func (*Database) Close

func (db *Database) Close() error

func (*Database) DeleteAccount

func (db *Database) DeleteAccount(keyUID string) error

func (*Database) DeleteIdentityImage added in v0.65.0

func (db *Database) DeleteIdentityImage(keyUID string) error

func (*Database) GetAccount added in v0.106.1

func (db *Database) GetAccount(keyUID string) (*Account, error)

func (*Database) GetAccountKDFIterationsNumber added in v0.111.5

func (db *Database) GetAccountKDFIterationsNumber(keyUID string) (kdfIterationsNumber int, err error)

func (*Database) GetAccounts

func (db *Database) GetAccounts() (rst []Account, err error)

func (*Database) GetIdentityImage added in v0.65.0

func (db *Database) GetIdentityImage(keyUID, it string) (*images.IdentityImage, error)

func (*Database) GetIdentityImages added in v0.65.0

func (db *Database) GetIdentityImages(keyUID string) (iis []*images.IdentityImage, err error)

Account images

func (*Database) SaveAccount

func (db *Database) SaveAccount(account Account) error

func (*Database) StoreIdentityImages added in v0.65.0

func (db *Database) StoreIdentityImages(keyUID string, iis []images.IdentityImage, publish bool) (err error)

func (*Database) SubscribeToIdentityImageChanges added in v0.66.2

func (db *Database) SubscribeToIdentityImageChanges() chan *IdentityImageSubscriptionChange

func (*Database) UpdateAccount

func (db *Database) UpdateAccount(account Account) error

func (*Database) UpdateAccountCustomizationColor added in v0.162.5

func (db *Database) UpdateAccountCustomizationColor(keyUID string, color string, clock uint64) (int64, error)

func (*Database) UpdateAccountKeycardPairing added in v0.83.0

func (db *Database) UpdateAccountKeycardPairing(keyUID string, keycardPairing string) error

func (*Database) UpdateAccountTimestamp

func (db *Database) UpdateAccountTimestamp(keyUID string, loginTimestamp int64) error

func (*Database) UpdateDisplayName added in v0.172.11

func (db *Database) UpdateDisplayName(keyUID string, displayName string) error

type IdentityImageSubscriptionChange added in v0.171.5

type IdentityImageSubscriptionChange struct {
	PublishExpected bool
}

type MultiAccountMarshaller added in v0.65.0

type MultiAccountMarshaller interface {
	ToMultiAccount() *Account
}

Directories

Path Synopsis
sql
mocks
URLUnfurlingMode mocks base method.
URLUnfurlingMode mocks base method.

Jump to

Keyboard shortcuts

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