user

package
v0.0.0-...-f73ca47 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestSession

func CreateTestSession(t *testing.T, usr *user.User, store sessions.Store) []*http.Cookie

func CreateTestUser

func CreateTestUser(t *testing.T, login string, userRepo user.Repository) *user.User

func GetValidContactDetails

func GetValidContactDetails() domain.ContactDetails

func RemoveTestUser

func RemoveTestUser(t *testing.T, id uuid.UUID, userRepo user.Repository)

Types

type PostgresUserRepository

type PostgresUserRepository struct {
	// contains filtered or unexported fields
}

func NewPostgresUserRepository

func NewPostgresUserRepository(db *gorp.DbMap) *PostgresUserRepository

func (PostgresUserRepository) Add

func (repo PostgresUserRepository) Add(ctx context.Context, user *user.User) error

func (PostgresUserRepository) Delete

func (repo PostgresUserRepository) Delete(ctx context.Context, id uuid.UUID) error

func (PostgresUserRepository) Exists

func (repo PostgresUserRepository) Exists(ctx context.Context, login string) (bool, error)

func (PostgresUserRepository) GetByID

func (repo PostgresUserRepository) GetByID(ctx context.Context, id uuid.UUID) (*user.User, error)

func (PostgresUserRepository) GetByLogin

func (repo PostgresUserRepository) GetByLogin(ctx context.Context, login string) (*user.User, error)

type RepositoryMock

type RepositoryMock struct {
	mock.Mock
}

RepositoryMock is an autogenerated mock type for the Repository type

func (*RepositoryMock) Add

func (_m *RepositoryMock) Add(ctx context.Context, _a1 *user.User) error

Add provides a mock function with given fields: ctx, _a1

func (*RepositoryMock) Delete

func (_m *RepositoryMock) Delete(ctx context.Context, id uuid.UUID) error

Delete provides a mock function with given fields: ctx, id

func (*RepositoryMock) Exists

func (_m *RepositoryMock) Exists(ctx context.Context, login string) (bool, error)

Exists provides a mock function with given fields: ctx, login

func (*RepositoryMock) GetByID

func (_m *RepositoryMock) GetByID(ctx context.Context, id uuid.UUID) (*user.User, error)

GetByID provides a mock function with given fields: ctx, id

func (*RepositoryMock) GetByLogin

func (_m *RepositoryMock) GetByLogin(ctx context.Context, login string) (*user.User, error)

GetByLogin provides a mock function with given fields: ctx, login

type UserDB

type UserDB struct {
	ID          uuid.UUID `db:"id"`
	Login       string    `db:"login"`
	Password    *string   `db:"password"`
	FirstName   string    `db:"name"`
	Surname     string    `db:"surname"`
	Mail        *string   `db:"mail"`
	PhoneNumber *string   `db:"phone_number"`
}

func GenerateTestUserDB

func GenerateTestUserDB(id uuid.UUID) UserDB

func (*UserDB) LoadUser

func (usrDB *UserDB) LoadUser(usr *user.User)

Jump to

Keyboard shortcuts

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