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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdentityExists                     = errors.New("identity already exists")
	ErrRepositoryEmailConstraint          = errors.New("identity with the same email already exists")
	ErrRepositorySocialGoogleConstraint   = errors.New("google identity with the same ID already exists")
	ErrRepositorySocialFacebookConstraint = errors.New("facebook identity with the same ID already exists")
	ErrRepositoryUnknownSocialNetworkType = errors.New("unknown social network type")
)

Functions

This section is empty.

Types

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func (*MockRepository) CreateEmailIdentity

func (_m *MockRepository) CreateEmailIdentity(identity models.Identity, executor database.QueryExecutor) (*models.Identity, error)

CreateEmailIdentity provides a mock function with given fields: identity, executor

func (*MockRepository) CreateSocialIdentity

func (_m *MockRepository) CreateSocialIdentity(identity models.Identity, executor database.QueryExecutor) (*models.Identity, error)

CreateSocialIdentity provides a mock function with given fields: identity, executor

func (*MockRepository) DeleteIdentitiesByAccountID

func (_m *MockRepository) DeleteIdentitiesByAccountID(accountID uuid.UUID, executor database.QueryExecutor) error

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

func (*MockRepository) DeleteIdentitiesByIdentityIDs

func (_m *MockRepository) DeleteIdentitiesByIdentityIDs(identityIDs []uuid.UUID, executor database.QueryExecutor) error

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

func (*MockRepository) GetEmailIdentityByEmail

func (_m *MockRepository) GetEmailIdentityByEmail(email string, executor database.QueryExecutor) (*models.Identity, error)

GetEmailIdentityByEmail provides a mock function with given fields: email, executor

func (*MockRepository) GetIdentitiesByAccountID

func (_m *MockRepository) GetIdentitiesByAccountID(accountID uuid.UUID, executor database.QueryExecutor) ([]*models.Identity, error)

GetIdentitiesByAccountID provides a mock function with given fields: accountID, executor

func (*MockRepository) GetIdentitiesByEmail

func (_m *MockRepository) GetIdentitiesByEmail(email string, executor database.QueryExecutor) ([]*models.Identity, error)

GetIdentitiesByEmail provides a mock function with given fields: email, executor

func (*MockRepository) GetIdentityBySocialID

func (_m *MockRepository) GetIdentityBySocialID(socialID string, socialNetworkType models.SocialNetworkType, executor database.QueryExecutor) (*models.Identity, error)

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

func (*MockRepository) UpdateIdentityStatus

func (_m *MockRepository) UpdateIdentityStatus(identityID uuid.UUID, identityStatus models.IdentityStatus, executor database.QueryExecutor) (*models.Identity, error)

UpdateIdentityStatus provides a mock function with given fields: identityID, identityStatus, executor

func (*MockRepository) UpdatePasswordHash

func (_m *MockRepository) UpdatePasswordHash(accountID uuid.UUID, passwordHash string, executor database.QueryExecutor) error

UpdatePasswordHash provides a mock function with given fields: accountID, passwordHash, executor

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
}

IdentityRepository is an interface for any Repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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