database

package
v0.0.0-...-eeb60d1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None                    = "none"
	PostgresSQL             = "pgsql"
	ErrSerializationFailure = "40001"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesDatabaseMethods

type FilesDatabaseMethods interface {
	AddFileTypeIfNotExist(string) error
	GetFileTypes() ([]models.FileType, error)
	GetFilesSize() (int, error)
	SaveFile(models.File) error
	GetFile([]string, []string) (models.File, error)
	GetFileList() ([]models.File, error)
}

FilesDatabaseMethods to manage Files Repository Methods

type Transaction

type Transaction interface {
	UsersDatabaseMethods
	FilesDatabaseMethods
	Commit() error
	Rollback() error
}

type TransactionMethods

type TransactionMethods interface {
	NewSerializableTransaction(ctx context.Context) (Transaction, error)
	NewTransaction(ctx context.Context, isolation sql.IsolationLevel) (Transaction, error)
}

type UsersDatabaseMethods

type UsersDatabaseMethods interface {
	GetUserByEmail(email string) (*models.UserWithPassword, error)
	CreateUser(spec models.UserCreationParameters) (models.User, error)
	UpdateUserLastLogin(userId int) error
	GetUserList() ([]models.User, error)
}

UsersDatabaseMethods to manage Users Repository Methods

Directories

Path Synopsis
ent
tag
Package mock_database is a generated GoMock package.
Package mock_database is a generated GoMock package.

Jump to

Keyboard shortcuts

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