Documentation
¶
Index ¶
- Constants
- func NewMetricsStorage(dbType, dbConnectionURL string) (*cosmosdb.MetricsStorageCosmosDB, error)
- type CertStorage
- type UserStorage
- type UserStorageWithCache
- func (s *UserStorageWithCache) ActivateSessionKey(userID []byte, active bool) error
- func (s *UserStorageWithCache) AddAccount(userID []byte, accountAddress []byte, signature []byte, ...) error
- func (s *UserStorageWithCache) AddSessionKey(userID []byte, key wecommon.GWSessionKey) error
- func (s *UserStorageWithCache) AddUser(userID []byte, privateKey []byte) error
- func (s *UserStorageWithCache) DeleteUser(userID []byte) error
- func (s *UserStorageWithCache) GetEncryptionKey() []byte
- func (s *UserStorageWithCache) GetUser(userID []byte) (*wecommon.GWUser, error)
- func (s *UserStorageWithCache) RemoveSessionKey(userID []byte) error
Constants ¶
const UserCacheSize = 10_000
Variables ¶
This section is empty.
Functions ¶
func NewMetricsStorage ¶ added in v1.0.0
func NewMetricsStorage(dbType, dbConnectionURL string) (*cosmosdb.MetricsStorageCosmosDB, error)
NewMetricsStorage is a factory function to create a MetricsStorage instance
Types ¶
type CertStorage ¶ added in v1.0.0
CertStorage defines the interface for certificate storage
func NewCertStorage ¶ added in v1.0.0
func NewCertStorage(dbType, dbConnectionURL string, randomKey []byte, encryptionEnabled bool, logger gethlog.Logger) (CertStorage, error)
NewCertStorage creates a new certificate storage instance based on the database type
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 AddSessionKey(userID []byte, key common.GWSessionKey) error ActivateSessionKey(userID []byte, active bool) error RemoveSessionKey(userID []byte) error GetUser(userID []byte) (*common.GWUser, error) GetEncryptionKey() []byte }
todo - pass the Context
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) ActivateSessionKey ¶ added in v1.0.0
func (s *UserStorageWithCache) ActivateSessionKey(userID []byte, active bool) error
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) AddSessionKey ¶ added in v1.0.0
func (s *UserStorageWithCache) AddSessionKey(userID []byte, key wecommon.GWSessionKey) error
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) GetEncryptionKey ¶ added in v1.0.0
func (s *UserStorageWithCache) GetEncryptionKey() []byte
GetEncryptionKey delegates to the underlying storage
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
func (*UserStorageWithCache) RemoveSessionKey ¶ added in v1.0.0
func (s *UserStorageWithCache) RemoveSessionKey(userID []byte) error