Documentation ¶
Index ¶
Constants ¶
View Source
const ( None = "none" PostgresSQL = "pgsql" ErrSerializationFailure = "40001" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { TransactionMethods UsersDatabaseMethods FilesDatabaseMethods }
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
Click to show internal directories.
Click to hide internal directories.