repository

package
v0.0.0-...-c2d5d3e Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresDB

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

Types

type Answer

type Answer interface {
}

type AuthPostgres

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

func NewAuthPostgres

func NewAuthPostgres(db *sqlx.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (r *AuthPostgres) CreateUser(user models.User) (int, error)

func (*AuthPostgres) GetUser

func (r *AuthPostgres) GetUser(username, password string) (models.User, error)

type Authorization

type Authorization interface {
	CreateUser(user models.User) (int, error)
	GetUser(username, password string) (models.User, error)
}

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	DBName   string
	SSLMode  string
}

type Question

type Question interface {
}

type Quiz

type Quiz interface {
	Create(userId int, quiz models.Quiz) (int, error)
}

type QuizPostgres

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

func NewQuizPostgres

func NewQuizPostgres(db *sqlx.DB) *QuizPostgres

func (*QuizPostgres) Create

func (r *QuizPostgres) Create(userId int, quiz models.Quiz) (int, error)

type Repository

type Repository struct {
	Authorization
	Quiz
	Question
	Answer
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

Jump to

Keyboard shortcuts

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