storage

package
v0.0.0-...-0b4a9b8 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyExists error
	ErrAlreadyExists = errors.New("already in storage")

	// ErrNotAccessible error
	ErrNotAccessible = errors.New("not accessible")

	// ErrBadRegisterRequest error
	ErrBadRegisterRequest = errors.New("wrong login or password. please try other")

	// ErrCreateUser error
	ErrCreateUser = errors.New("got error while creating user")

	// ErrCreateToken error
	ErrCreateToken = errors.New("got error while creating token")

	// ErrGetByLogin error
	ErrGetByLogin = errors.New("the user was not found")

	// ErrGetByID error
	ErrGetByID = errors.New("got error while getting by id")

	// ErrHashingPassword error
	ErrHashingPassword = errors.New("got error while hashing password")

	// ErrComparingPasswords error
	ErrComparingPasswords = errors.New("got error while comparing passwords")

	// ErrNotFound error
	ErrNotFound = errors.New("not found")

	// ErrInserting error
	ErrInserting = errors.New("got error while inserting in database")

	//ErrBadRequestId error
	ErrBadRequestId = errors.New("got error while validating id")

	//ErrInternalServer error
	ErrInternalServer = errors.New("failed to retrieve todo")

	//ErrTableMigrations error
	ErrTableMigrations = errors.New("migrations failed")
)

Functions

This section is empty.

Types

type ColumnStorage

type ColumnStorage interface {
	CreateColumn(ctx context.Context, column *model.ColumDTO) error
	DeleteColumn(ctx context.Context, name string, projectId uuid.UUID) error
	GetColumnByName(ctx context.Context, name string, projectId uuid.UUID) (*model.ColumDTO, error)
	UpdateColumn(ctx context.Context, column *model.ColumDTO, name string, projectId uuid.UUID) error
	GetAllColumns(ctx context.Context, projectId uuid.UUID) ([]model.ColumDTO, error)
}

type Interface

type Interface interface {
	User() UserStorage
	Todo() TodoStorage
	Project() ProjectStorage
	Column() ColumnStorage
}

type ProjectStorage

type ProjectStorage interface {
	GetMyByName(ctx context.Context, name string, createdBy uuid.UUID) error
	GetByID(ctx context.Context, id uuid.UUID) (*model.ProjectDTO, error)
	GetMyProjects(ctx context.Context, createdByID uuid.UUID) ([]model.ProjectDTO, error)
	UpdateName(ctx context.Context, name string, id uuid.UUID) error
	Delete(ctx context.Context, id uuid.UUID) error
	Create(ctx context.Context, project *model.ProjectDTO) error
}

type TodoStorage

type TodoStorage interface {
	Create(ctx context.Context, todo *model.TodoDTO) error
	GetByID(ctx context.Context, id uuid.UUID) (*model.TodoDTO, error)
	GetAll(ctx context.Context, createdBy uuid.UUID) ([]model.TodoDTO, error)
	Update(ctx context.Context, todo *model.TodoDTO, id uuid.UUID) error
	Delete(ctx context.Context, id uuid.UUID) error
}

type UserStorage

type UserStorage interface {
	Create(ctx context.Context, user *model.UserDTO) error
	GetByID(ctx context.Context, id uuid.UUID) (*model.UserDTO, error)
	GetByLogin(ctx context.Context, login string) (*model.UserDTO, error)
	ChangePassword(ctx context.Context, password string, id uuid.UUID) error
	GetAll(ctx context.Context) ([]model.UserDTO, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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