repository

package
v0.0.0-...-0366c93 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 4 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 Config

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

type File

type File interface {
	GetAll(userCode string) ([]common.File, error)
	DeleteAll(userCode string) error
	Create(files []common.UploadedFile, userCode string) error
	UpdateStatus(userCode, errorMess string, status common.ProcessStatus) error
	GetByCode(userCode string) (common.File, error)
}

File - интерфейс для работы с файлом

type FilePostgres

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

func NewFilePostgres

func NewFilePostgres(db *sqlx.DB) *FilePostgres

func (*FilePostgres) Create

func (r *FilePostgres) Create(files []common.UploadedFile, userCode string) error

func (*FilePostgres) DeleteAll

func (r *FilePostgres) DeleteAll(userCode string) error

func (*FilePostgres) GetAll

func (r *FilePostgres) GetAll(userCode string) ([]common.File, error)

func (*FilePostgres) GetByCode

func (r *FilePostgres) GetByCode(userCode string) (common.File, error)

func (*FilePostgres) UpdateStatus

func (r *FilePostgres) UpdateStatus(userCode, errorMess string, status common.ProcessStatus) error

type Repository

type Repository struct {
	User
	File
}

Repository - репозиторий

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

NewRepository - конструктор

type User

type User interface {
	CreateUser(userCode uuid.UUID) error
	GetUser(code uuid.UUID) (common.User, error)
}

User - интерфейс для работы с пользователем

type UserPostgres

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

func NewUserPostgres

func NewUserPostgres(db *sqlx.DB) *UserPostgres

func (*UserPostgres) CreateUser

func (r *UserPostgres) CreateUser(userCode uuid.UUID) error

func (*UserPostgres) GetUser

func (r *UserPostgres) GetUser(code uuid.UUID) (common.User, error)

Jump to

Keyboard shortcuts

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