dao

package
v0.0.0-...-ca2b8f7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCredentialsAlreadyExist = errors.New("credentials already exist")
View Source
var ErrCredentialsNotFound = errors.New("credentials not found")

Functions

This section is empty.

Types

type CreateCredentials

type CreateCredentials interface {
	Exec(
		ctx context.Context, id uuid.UUID, now time.Time, request *CreateCredentialsRequest,
	) (*entities.Credential, error)
}

func NewCreateCredentials

func NewCreateCredentials(database bun.IDB) CreateCredentials

type CreateCredentialsRequest

type CreateCredentialsRequest struct {
	Email                  string
	Role                   entities.Role
	EmailValidationTokenID string
	PasswordTokenID        string
	ResetPasswordTokenID   string
}

type ExistsCredentials

type ExistsCredentials interface {
	Exec(ctx context.Context, request *ExistsCredentialsRequest) (bool, error)
}

func NewExistsCredentials

func NewExistsCredentials(database bun.IDB) ExistsCredentials

type ExistsCredentialsRequest

type ExistsCredentialsRequest struct {
	Email string
	ID    uuid.UUID
}

type GetCredentials

type GetCredentials interface {
	Exec(ctx context.Context, request *GetCredentialsRequest) (*entities.Credential, error)
}

func NewGetCredentials

func NewGetCredentials(database bun.IDB) GetCredentials

type GetCredentialsRequest

type GetCredentialsRequest struct {
	Email string
	ID    uuid.UUID
}

type ListCredentials

type ListCredentials interface {
	Exec(ctx context.Context, ids []uuid.UUID) ([]*entities.Credential, error)
}

func NewListCredentials

func NewListCredentials(database bun.IDB) ListCredentials

type SearchCredentials

type SearchCredentials interface {
	Exec(ctx context.Context, request *SearchCredentialsRequest) (uuid.UUIDs, error)
}

func NewSearchCredentials

func NewSearchCredentials(database bun.IDB) SearchCredentials

type SearchCredentialsRequest

type SearchCredentialsRequest struct {
	Limit         int
	Offset        int
	Sort          entities.SortCredentials
	SortDirection database.SortDirection
	Emails        []string
	Roles         []entities.Role
}

type UpdateCredentials

type UpdateCredentials interface {
	Exec(
		ctx context.Context, id uuid.UUID, now time.Time, data *UpdateCredentialsRequest,
	) (*entities.Credential, error)
}

func NewUpdateCredentials

func NewUpdateCredentials(database bun.IDB) UpdateCredentials

type UpdateCredentialsRequest

type UpdateCredentialsRequest struct {
	Email string
	Role  entities.Role

	EmailValidationTokenID        string
	PendingEmailValidationTokenID string
	PasswordTokenID               string
	ResetPasswordTokenID          string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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