storage

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const UserCacheSize = 10_000

Variables

This section is empty.

Functions

This section is empty.

Types

type UserStorage added in v0.28.0

type UserStorage interface {
	AddUser(userID []byte, privateKey []byte) error
	DeleteUser(userID []byte) error
	AddAccount(userID []byte, accountAddress []byte, signature []byte, signatureType viewingkey.SignatureType) error
	GetUser(userID []byte) (*common.GWUser, error)
}

func New

func New(dbType, dbConnectionURL, dbPath string, randomKey []byte, logger gethlog.Logger) (UserStorage, error)

type UserStorageWithCache added in v0.28.0

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

UserStorageWithCache implements the UserStorage interface with caching

func NewUserStorageWithCache added in v0.28.0

func NewUserStorageWithCache(storage UserStorage, logger log.Logger) (*UserStorageWithCache, error)

NewUserStorageWithCache creates a new UserStorageWithCache instance

func (*UserStorageWithCache) AddAccount added in v0.28.0

func (s *UserStorageWithCache) AddAccount(userID []byte, accountAddress []byte, signature []byte, signatureType viewingkey.SignatureType) error

AddAccount adds an account to a user and invalidates the cache for the userID

func (*UserStorageWithCache) AddUser added in v0.28.0

func (s *UserStorageWithCache) AddUser(userID []byte, privateKey []byte) error

AddUser adds a new user and invalidates the cache for the userID

func (*UserStorageWithCache) DeleteUser added in v0.28.0

func (s *UserStorageWithCache) DeleteUser(userID []byte) error

DeleteUser deletes a user and invalidates the cache for the userID

func (*UserStorageWithCache) GetUser added in v0.28.0

func (s *UserStorageWithCache) GetUser(userID []byte) (*wecommon.GWUser, error)

GetUser retrieves a user from the cache or underlying storage

Directories

Path Synopsis
database

Jump to

Keyboard shortcuts

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