fake

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserStorage

func NewUserStorage() (model.UserStorage, error)

NewUserStorage creates and inits in-memory user storage. Use it only for test purposes and in CI, all data is wiped on exit.

Types

type UserStorage

type UserStorage struct{}

UserStorage is an in-memory user storage .

func (*UserStorage) AddUserWithFederatedID

func (us *UserStorage) AddUserWithFederatedID(user model.User, provider string, id, role string) (model.User, error)

AddUserWithFederatedID returns randomly generated user.

func (*UserStorage) AddUserWithPassword

func (us *UserStorage) AddUserWithPassword(user model.User, password, role string, isAnonymous bool) (model.User, error)

AddUserWithPassword creates new user and saves it in the database.

func (*UserStorage) AllDeviceTokens

func (us *UserStorage) AllDeviceTokens(userID string) ([]string, error)

TODO: implement get all device tokens logic

func (*UserStorage) AttachDeviceToken

func (us *UserStorage) AttachDeviceToken(id, token string) error

AttachDeviceToken does nothing here.

func (*UserStorage) CheckPassword

func (us *UserStorage) CheckPassword(id, password string) error

CheckPassword does nothig here.

func (*UserStorage) Close

func (us *UserStorage) Close()

Close does nothing here.

func (*UserStorage) DeleteUser

func (us *UserStorage) DeleteUser(id string) error

DeleteUser does nothing here.

func (*UserStorage) DetachDeviceToken

func (us *UserStorage) DetachDeviceToken(token string) error

DetachDeviceToken does nothing here.

func (*UserStorage) FetchUsers

func (us *UserStorage) FetchUsers(filterString string, skip, limit int) ([]model.User, int, error)

FetchUsers returns randomly generated user enclosed in slice.

func (*UserStorage) ImportJSON

func (us *UserStorage) ImportJSON(data []byte) error

ImportJSON imports data from JSON.

func (*UserStorage) RequestScopes

func (us *UserStorage) RequestScopes(userID string, scopes []string) ([]string, error)

RequestScopes always returns requested scopes.

func (*UserStorage) ResetPassword

func (us *UserStorage) ResetPassword(id, password string) error

ResetPassword does nothing here.

func (*UserStorage) Scopes

func (us *UserStorage) Scopes() []string

Scopes returns supported scopes, could be static data of database.

func (*UserStorage) UpdateLoginMetadata

func (us *UserStorage) UpdateLoginMetadata(userID string)

UpdateLoginMetadata does nothing here.

func (*UserStorage) UpdateUser

func (us *UserStorage) UpdateUser(userID string, newUser model.User) (model.User, error)

UpdateUser returns what it receives.

func (*UserStorage) UserByEmail

func (us *UserStorage) UserByEmail(email string) (model.User, error)

UserByEmail returns randomly generated user.

func (*UserStorage) UserByFederatedID

func (us *UserStorage) UserByFederatedID(provider string, id string) (model.User, error)

UserByFederatedID returns randomly generated user.

func (*UserStorage) UserByID

func (us *UserStorage) UserByID(id string) (model.User, error)

UserByID returns randomly generated user.

func (*UserStorage) UserByPhone

func (us *UserStorage) UserByPhone(phone string) (model.User, error)

UserByPhone returns randomly generated user.

func (*UserStorage) UserBySocialID

func (us *UserStorage) UserBySocialID(id string) (model.User, error)

UserBySocialID returns randomly generated user.

func (*UserStorage) UserByUsername

func (us *UserStorage) UserByUsername(username string) (model.User, error)

UserByUsername returns randomly generated user.

Jump to

Keyboard shortcuts

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