repository

package
v0.0.0-...-fa04af2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqlite3DB

func NewSqlite3DB(cfg Config) (*sqlx.DB, error)

NewSqlite3DB - open connect and ping trying

Types

type Account

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

func NewAccount

func NewAccount(db *sqlx.DB) *Account

func (*Account) CreateAccount

func (r *Account) CreateAccount(account domain.Account) error

func (*Account) DeleteAccount

func (r *Account) DeleteAccount(accountPublicId uuid.UUID) error

func (*Account) GetByCredentials

func (r *Account) GetByCredentials(email, password string) (domain.Account, error)

func (*Account) UpdateAccountInfo

func (r *Account) UpdateAccountInfo(input domain.UpdateAccountInput) error

func (*Account) UpdateAccountRole

func (r *Account) UpdateAccountRole(input domain.UpdateAccountRoleInput) error

type Accounter

type Accounter interface {
	CreateAccount(account domain.Account) error
	UpdateAccountInfo(input domain.UpdateAccountInput) error
	UpdateAccountRole(input domain.UpdateAccountRoleInput) error
	DeleteAccount(accountPublicId uuid.UUID) error
	GetByCredentials(email, password string) (domain.Account, error)
}

type Config

type Config struct {
	Driver string
}

Config - db

type Repository

type Repository struct {
	Accounter
}

Repository - repo

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

NewRepository - constructor

Jump to

Keyboard shortcuts

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