accountutils

package
v2.331.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InMemoryDir                 = ":memory:"
	DefaultPushKeyFilename      = "push.key"
	AccountMetafileName         = "account_meta"
	AccountNetConfFileName      = "account_net_conf"
	MessengerDatabaseFilename   = "messenger.sqlite"
	ReplicationDatabaseFilename = "replication.sqlite"
	StorageKeyName              = "storage"
	StorageKeySize              = 32
)

Variables

This section is empty.

Functions

func GetAccountAppStorage added in v2.331.0

func GetAccountAppStorage(rootDir string, accountID string, key []byte) (datastore.Datastore, error)

func GetAccountDir added in v2.315.0

func GetAccountDir(rootDir, accountID string) string

func GetAccountMetaForName

func GetAccountMetaForName(rootDir string, accountID string, storageKey []byte, logger *zap.Logger) (*accounttypes.AccountMetadata, error)

func GetAccountsDir added in v2.315.0

func GetAccountsDir(rootDir string) string

func GetDatastoreDir

func GetDatastoreDir(dir string) (string, error)

func GetDevicePushKeyForPath

func GetDevicePushKeyForPath(filePath string, createIfMissing bool) (pk *[cryptoutil.KeySize]byte, sk *[cryptoutil.KeySize]byte, err error)

func GetGormDBForPath added in v2.311.2

func GetGormDBForPath(dbPath string, key []byte, logger *zap.Logger) (*gorm.DB, func(), error)

func GetMessengerDBForPath

func GetMessengerDBForPath(dir string, key []byte, logger *zap.Logger) (*gorm.DB, func(), error)

func GetOrCreateMasterStorageKey added in v2.331.0

func GetOrCreateMasterStorageKey(ks NativeKeystore) ([]byte, error)

func GetOrCreateStorageKeyForAccount added in v2.331.0

func GetOrCreateStorageKeyForAccount(ks NativeKeystore, accountID string) ([]byte, error)

func GetReplicationDBForPath added in v2.311.2

func GetReplicationDBForPath(dir string, logger *zap.Logger) (*gorm.DB, func(), error)

func GetRootDatastoreForPath

func GetRootDatastoreForPath(dir string, key []byte, logger *zap.Logger) (datastore.Batching, error)

func ListAccounts

func ListAccounts(rootDir string, ks NativeKeystore, logger *zap.Logger) ([]*accounttypes.AccountMetadata, error)

Types

type NativeKeystore added in v2.319.0

type NativeKeystore interface {
	Put(key string, data []byte) error
	Get(key string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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