identity

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 (
	ErrIdentityExists             = errors.New("identity exists")
	ErrIdentityPasswordGeneration = errors.New("password generation error")
	ErrNoIdentityFound            = errors.New("no identities found")
	ErrNoIdentityUpdated          = errors.New("identities with sent params are not updated")
)

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) ConfirmIdentity

func (_m *MockService) ConfirmIdentity(identityID uuid.UUID, tx *sql.Tx) (*models.Identity, error)

ConfirmIdentity provides a mock function with given fields: identityID, tx

func (*MockService) CreateEmailIdentity

func (_m *MockService) CreateEmailIdentity(accountID uuid.UUID, email string, password string, identityStatus models.IdentityStatus, tx *sql.Tx) (*models.Identity, error)

CreateEmailIdentity provides a mock function with given fields: accountID, email, password, identityStatus, tx

func (*MockService) CreateOAuthIdentity

func (_m *MockService) CreateOAuthIdentity(accountID uuid.UUID, socialID string, socialNetworkType models.SocialNetworkType, email string, tx *sql.Tx) (*models.Identity, error)

CreateOAuthIdentity provides a mock function with given fields: accountID, socialID, socialNetworkType, email, tx

func (*MockService) DeleteIdentitiesByAccountID

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

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

func (*MockService) DeleteIdentitiesByIdentityIDs

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

DeleteIdentitiesByIdentityIDs provides a mock function with given fields: identityIDs, tx

func (*MockService) GetEmailIdentityByEmail

func (_m *MockService) GetEmailIdentityByEmail(email string) (*models.Identity, error)

GetEmailIdentityByEmail provides a mock function with given fields: email

func (*MockService) GetEmailIdentityByEmailAndPassword

func (_m *MockService) GetEmailIdentityByEmailAndPassword(email string, password string) (*models.Identity, error)

GetEmailIdentityByEmailAndPassword provides a mock function with given fields: email, password

func (*MockService) GetIdentitiesByAccountID

func (_m *MockService) GetIdentitiesByAccountID(accountID uuid.UUID) ([]*models.Identity, error)

GetIdentitiesByAccountID provides a mock function with given fields: accountID

func (*MockService) GetIdentitiesByEmail

func (_m *MockService) GetIdentitiesByEmail(email string) ([]*models.Identity, error)

GetIdentitiesByEmail provides a mock function with given fields: email

func (*MockService) GetIdentityBySocialID

func (_m *MockService) GetIdentityBySocialID(socialID string, socialNetworkType models.SocialNetworkType) (*models.Identity, error)

GetIdentityBySocialID provides a mock function with given fields: socialID, socialNetworkType

type Repository

type Repository interface {
	GetIdentitiesByAccountID(executor database.QueryExecutor, accountID uuid.UUID) ([]*models.Identity, error)
	UpdateIdentityStatus(executor database.QueryExecutor, identityID uuid.UUID, identityStatus models.IdentityStatus) (*models.Identity, error)
	CreateEmailIdentity(executor database.QueryExecutor, identity models.Identity) (*models.Identity, error)
	CreateSocialIdentity(executor database.QueryExecutor, identity models.Identity) (*models.Identity, error)
	GetIdentitiesByEmail(executor database.QueryExecutor, email string) ([]*models.Identity, error)
	GetEmailIdentityByEmail(executor database.QueryExecutor, email string) (*models.Identity, error)
	GetIdentityBySocialID(executor database.QueryExecutor, socialID string, socialNetworkType models.SocialNetworkType) (*models.Identity, error)
	//CreateIdentity(user models.DBIdentity) (*models.Identity, error)
	UpdatePasswordHash(executor database.QueryExecutor, accountID uuid.UUID, passwordHash string) error
	DeleteIdentitiesByAccountID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteIdentitiesByIdentityIDs(executor database.QueryExecutor, identityIDs []uuid.UUID) error
}

type Service

type Service interface {
	GetIdentitiesByAccountID(executor database.QueryExecutor, accountID uuid.UUID) ([]*models.Identity, error)
	GetIdentityBySocialID(executor database.QueryExecutor, socialID string, socialNetworkType models.SocialNetworkType) (*models.Identity, error)
	GetIdentitiesByEmail(executor database.QueryExecutor, email string) ([]*models.Identity, error)
	GetEmailIdentityByEmail(executor database.QueryExecutor, email string) (*models.Identity, error)
	GetEmailIdentityByEmailAndPassword(executor database.QueryExecutor, email, password string) (*models.Identity, error)
	CreateEmailIdentity(
		executor database.QueryExecutor,
		accountID uuid.UUID,
		email, password string,
		identityStatus models.IdentityStatus,
	) (*models.Identity, error)
	CreateOAuthIdentity(
		executor database.QueryExecutor,
		accountID uuid.UUID,
		socialID string,
		socialNetworkType models.SocialNetworkType,
		email string,
	) (*models.Identity, error)
	DeleteIdentitiesByAccountID(executor database.QueryExecutor, accountID uuid.UUID) error
	DeleteIdentitiesByIdentityIDs(executor database.QueryExecutor, identityIDs []uuid.UUID) error
	ConfirmIdentity(executor database.QueryExecutor, identityID uuid.UUID) (*models.Identity, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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