account

package
v0.0.0-...-ca0f7d1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccountNotFound   = errors.New("account not found")
	ErrNoAccountsUpdated = errors.New("accounts with sent params are not updated")
	ErrAccountNameExists = errors.New("account with sent name exists")
)

Functions

This section is empty.

Types

type MockService

type MockService struct {
	mock.Mock
}

MockService is an autogenerated mock type for the Service type

func (*MockService) ConfirmAccount

func (_m *MockService) ConfirmAccount(accountID uuid.UUID, tx *sql.Tx) (*models.Account, error)

ConfirmAccount provides a mock function with given fields: accountID, tx

func (*MockService) CreateAccount

func (_m *MockService) CreateAccount(tx *sql.Tx, email string, accountStatus models.AccountStatus) (*models.Account, error)

CreateAccount provides a mock function with given fields: tx, email, accountStatus

func (*MockService) CreateAccountWithOAuth

func (_m *MockService) CreateAccountWithOAuth(email string, firstName string, lastName string, avatarURL string, tx *sql.Tx) (*models.Account, error)

CreateAccountWithOAuth provides a mock function with given fields: email, firstName, lastName, avatarURL, tx

func (*MockService) DeactivateAccountByID

func (_m *MockService) DeactivateAccountByID(accountID uuid.UUID, tx *sql.Tx) error

DeactivateAccountByID provides a mock function with given fields: accountID, tx

func (*MockService) DeleteUnconfirmedAccountsByAccountIDs

func (_m *MockService) DeleteUnconfirmedAccountsByAccountIDs(accountIDs []uuid.UUID, tx *sql.Tx) error

DeleteUnconfirmedAccountsByAccountIDs provides a mock function with given fields: accountIDs, tx

func (*MockService) GetAccountByID

func (_m *MockService) GetAccountByID(accountID uuid.UUID) (*models.Account, error)

GetAccountByID provides a mock function with given fields: accountID

func (*MockService) GetAccountByName

func (_m *MockService) GetAccountByName(accountName string) (*models.Account, error)

GetAccountByName provides a mock function with given fields: accountName

func (*MockService) LoginAccount

func (_m *MockService) LoginAccount(account uuid.UUID, clientIP string, tx *sql.Tx) (*models.Account, error)

LoginAccount provides a mock function with given fields: account, clientIP, tx

func (*MockService) UpdateAccountName

func (_m *MockService) UpdateAccountName(accountID uuid.UUID, name string) error

UpdateAccountName provides a mock function with given fields: accountID, name

type Repository

type Repository interface {
	GetAccountByID(executor database.QueryExecutor, accountID uuid.UUID) (*models.Account, error)
	GetAccountByName(executor database.QueryExecutor, accountName string) (*models.Account, error)
	CreateAccount(executor database.QueryExecutor, account models.Account) (*models.Account, error)
	LoginAccount(executor database.QueryExecutor, account uuid.UUID, clientIP string) (*models.Account, error)
	ConfirmAccount(executor database.QueryExecutor, accountID uuid.UUID) (*models.Account, error)
	UpdateAccountName(executor database.QueryExecutor, accountID uuid.UUID, name string) error
	DeactivateAccountByID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteUnconfirmedAccountsByAccountIDs(
		executor database.QueryExecutor,
		accountIDs []uuid.UUID,
	) error
}

type Service

type Service interface {
	GetAccountByID(executor database.QueryExecutor, accountID uuid.UUID) (*models.Account, error)
	GetAccountByName(executor database.QueryExecutor, accountName string) (*models.Account, error)
	LoginAccount(
		executor database.QueryExecutor,
		account uuid.UUID,
		clientIP string,
	) (*models.Account, error)
	CreateAccount(
		executor database.QueryExecutor,
		email string,
		accountStatus models.AccountStatus,
	) (*models.Account, error)
	CreateAccountWithOAuth(
		executor database.QueryExecutor,
		email, firstName, lastName, avatarURL string,
	) (*models.Account, error)
	DeactivateAccountByID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteUnconfirmedAccountsByAccountIDs(executor database.QueryExecutor, accountIDs []uuid.UUID) error
	UpdateAccountName(executor database.QueryExecutor, accountID uuid.UUID, name string) error
	ConfirmAccount(executor database.QueryExecutor, accountID uuid.UUID) (*models.Account, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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