repository

package
v0.0.0-...-a67f385 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 6 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 Auth

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

Auth - repo

func NewAuth

func NewAuth(db *sqlx.DB) *Auth

func (*Auth) CreateAccount

func (r *Auth) CreateAccount(account models.Account) (int, error)

func (*Auth) GetAccount

func (r *Auth) GetAccount(username, password string) (models.Account, error)

func (*Auth) GetAccountById

func (r *Auth) GetAccountById(accountId int) (models.Account, error)

type Authorizer

type Authorizer interface {
	CreateAccount(account models.Account) (int, error)
	GetAccount(username, password string) (models.Account, error)
	GetAccountById(accountId int) (models.Account, error)
}

type Config

type Config struct {
	Driver string
}

Config - db

type Repository

type Repository struct {
	Authorizer
	Tasker
}

Repository - repo

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

NewRepository - constructor

type Task

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

func NewTask

func NewTask(db *sqlx.DB) *Task

func (*Task) CreateTask

func (r *Task) CreateTask(task models.Task) (int, error)

type Tasker

type Tasker interface {
	CreateTask(task models.Task) (int, error)
}

Jump to

Keyboard shortcuts

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