Documentation ¶
Index ¶
- Variables
- func NewError(err error) error
- type DBStorage
- func (s *DBStorage) ConnectRepository(name string, sqlxDB *sqlx.DB) error
- func (s *DBStorage) GetCategoriesRepository() *repository.CategoriesRepository
- func (s *DBStorage) GetContractsRepository() *repository.ContractsRepository
- func (s *DBStorage) GetFilesRepository() *repository.FilesRepository
- func (s *DBStorage) GetMenusRepository() *repository.MenusRepository
- func (s *DBStorage) GetSlidersRepository() *repository.SlidersRepository
- func (s *DBStorage) GetUsersRepository() *repository.UsersRepository
- func (s *DBStorage) Init(ctx context.Context, sqlxDB *sqlx.DB) (*sqlx.DB, error)
- type DBStorageInterface
- type Error
Constants ¶
This section is empty.
Variables ¶
View Source
var NewPGSQLStorage = NewDBStorage
Functions ¶
Types ¶
type DBStorage ¶
type DBStorage struct { DSN string // contains filtered or unexported fields }
DBStorage - database storage functionality. Use PostgreSQL version 14 or higher as a DBMS.
func (*DBStorage) ConnectRepository ¶
func (*DBStorage) GetCategoriesRepository ¶
func (s *DBStorage) GetCategoriesRepository() *repository.CategoriesRepository
func (*DBStorage) GetContractsRepository ¶
func (s *DBStorage) GetContractsRepository() *repository.ContractsRepository
func (*DBStorage) GetFilesRepository ¶
func (s *DBStorage) GetFilesRepository() *repository.FilesRepository
func (*DBStorage) GetMenusRepository ¶
func (s *DBStorage) GetMenusRepository() *repository.MenusRepository
func (*DBStorage) GetSlidersRepository ¶
func (s *DBStorage) GetSlidersRepository() *repository.SlidersRepository
func (*DBStorage) GetUsersRepository ¶
func (s *DBStorage) GetUsersRepository() *repository.UsersRepository
type DBStorageInterface ¶
type DBStorageInterface interface { Init(ctx context.Context, sqlxDB *sqlx.DB) (*sqlx.DB, error) ConnectRepository(name string, sqlxDB *sqlx.DB) error GetUsersRepository() *repository.UsersRepository GetContractsRepository() *repository.ContractsRepository GetMenusRepository() *repository.MenusRepository GetSlidersRepository() *repository.SlidersRepository GetFilesRepository() *repository.FilesRepository GetCategoriesRepository() *repository.CategoriesRepository }
func NewDBStorage ¶
func NewDBStorage(dsn string) DBStorageInterface
func SetupStorage ¶
func SetupStorage(ctx context.Context, dsn string) (DBStorageInterface, error)
Directories ¶
Path | Synopsis |
---|---|
Package db contains custom errors for database
|
Package db contains custom errors for database |
repository
Package repository contains all database logic for storage
|
Package repository contains all database logic for storage |
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.