repository

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

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 9 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 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 repoModel.User) (uuid.UUID, error)

func (*AuthPostgres) DeleteAccount

func (r *AuthPostgres) DeleteAccount(userId uuid.UUID) error

func (*AuthPostgres) GetUser

func (r *AuthPostgres) GetUser(user repoModel.User) (repoModel.User, error)

type Authorization

type Authorization interface {
	CreateUser(user repoModel.User) (uuid.UUID, error)
	GetUser(user repoModel.User) (repoModel.User, error)
	DeleteAccount(userId uuid.UUID) error
}

type CategPostgres

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

func NewCategPostgres

func NewCategPostgres(db *sqlx.DB) *CategPostgres

func (*CategPostgres) Create

func (r *CategPostgres) Create(category repoModel.Category) (uuid.UUID, error)

func (*CategPostgres) DeleteById

func (r *CategPostgres) DeleteById(userId, categoryId uuid.UUID) error

func (*CategPostgres) GetAll

func (r *CategPostgres) GetAll(userId uuid.UUID) ([]repoModel.Category, error)

func (*CategPostgres) GetById

func (r *CategPostgres) GetById(userId, categoryId uuid.UUID) (repoModel.Category, error)

func (*CategPostgres) Update

func (r *CategPostgres) Update(categoryUpdate repoModel.Category) error

type Category

type Category interface {
	Create(category repoModel.Category) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]repoModel.Category, error)
	GetById(userId, categoryId uuid.UUID) (repoModel.Category, error)
	DeleteById(userId, categoryId uuid.UUID) error
	Update(category repoModel.Category) error
}

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	DBName   string
	SSLMode  string
}
type Link interface {
	Create(link repoModel.Link, categories []uuid.UUID) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]repoModel.Link, error)
	GetById(userId, linkId uuid.UUID) (repoModel.Link, error)
	DeleteById(userId, linkId uuid.UUID) error
	Update(link repoModel.Link, categories []uuid.UUID) error
}

type LinkPostgres

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

func NewLinkPostgres

func NewLinkPostgres(db *sqlx.DB) *LinkPostgres

func (LinkPostgres) Create

func (r LinkPostgres) Create(link repoModel.Link, categories []uuid.UUID) (uuid.UUID, error)

func (LinkPostgres) DeleteById

func (r LinkPostgres) DeleteById(userId, linkId uuid.UUID) error

func (LinkPostgres) GetAll

func (r LinkPostgres) GetAll(userId uuid.UUID) ([]repoModel.Link, error)

func (LinkPostgres) GetById

func (r LinkPostgres) GetById(userId, linkId uuid.UUID) (repoModel.Link, error)

func (LinkPostgres) Update

func (r LinkPostgres) Update(linkUpdate repoModel.Link, categories []uuid.UUID) error

type Repository

type Repository struct {
	Authorization
	Link
	Category
	Statistic
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type StatPostgres

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

func NewStatPostgres

func NewStatPostgres(db *sqlx.DB) *StatPostgres

func (StatPostgres) Create

func (r StatPostgres) Create(category repoModel.Statistic) (uuid.UUID, error)

func (StatPostgres) GetAll

func (r StatPostgres) GetAll(userId uuid.UUID) ([]repoModel.Statistic, error)

type Statistic

type Statistic interface {
	Create(category repoModel.Statistic) (uuid.UUID, error)
	GetAll(userId uuid.UUID) ([]repoModel.Statistic, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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