Documentation ¶
Index ¶
- Variables
- type PGOptions
- type PostgresDatabase
- func (p *PostgresDatabase) AddFileTypeIfNotExist(id string) error
- func (p *PostgresDatabase) CreateUser(spec models.UserCreationParameters) (models.User, error)
- func (p *PostgresDatabase) GetFile(name []string, tags []string) (models.File, error)
- func (p *PostgresDatabase) GetFileList() ([]models.File, error)
- func (p *PostgresDatabase) GetFileTypes() ([]models.FileType, error)
- func (p *PostgresDatabase) GetFilesSize() (int, error)
- func (p *PostgresDatabase) GetUserByEmail(email string) (*models.UserWithPassword, error)
- func (p *PostgresDatabase) GetUserList() ([]models.User, error)
- func (p PostgresDatabase) Migrate() error
- func (p *PostgresDatabase) NewSerializableTransaction(ctx context.Context) (database.Transaction, error)
- func (p *PostgresDatabase) NewTransaction(ctx context.Context, isolation sql.IsolationLevel) (database.Transaction, error)
- func (p *PostgresDatabase) SaveFile(file models.File) error
- func (p *PostgresDatabase) UpdateUserLastLogin(userId int) error
- type PostgresTransaction
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserWithEmailExist = errors.New("User with the same given email exists")
Functions ¶
This section is empty.
Types ¶
type PostgresDatabase ¶
type PostgresDatabase struct {
// contains filtered or unexported fields
}
func NewPostgresDatabase ¶
func NewPostgresDatabase(options PGOptions, runMigrations bool) (*PostgresDatabase, error)
func (*PostgresDatabase) AddFileTypeIfNotExist ¶
func (p *PostgresDatabase) AddFileTypeIfNotExist(id string) error
func (*PostgresDatabase) CreateUser ¶
func (p *PostgresDatabase) CreateUser(spec models.UserCreationParameters) (models.User, error)
func (*PostgresDatabase) GetFileList ¶
func (p *PostgresDatabase) GetFileList() ([]models.File, error)
func (*PostgresDatabase) GetFileTypes ¶
func (p *PostgresDatabase) GetFileTypes() ([]models.FileType, error)
func (*PostgresDatabase) GetFilesSize ¶
func (p *PostgresDatabase) GetFilesSize() (int, error)
func (*PostgresDatabase) GetUserByEmail ¶
func (p *PostgresDatabase) GetUserByEmail(email string) (*models.UserWithPassword, error)
func (*PostgresDatabase) GetUserList ¶
func (p *PostgresDatabase) GetUserList() ([]models.User, error)
func (PostgresDatabase) Migrate ¶
func (p PostgresDatabase) Migrate() error
func (*PostgresDatabase) NewSerializableTransaction ¶
func (p *PostgresDatabase) NewSerializableTransaction(ctx context.Context) (database.Transaction, error)
func (*PostgresDatabase) NewTransaction ¶
func (p *PostgresDatabase) NewTransaction(ctx context.Context, isolation sql.IsolationLevel) (database.Transaction, error)
func (*PostgresDatabase) UpdateUserLastLogin ¶
func (p *PostgresDatabase) UpdateUserLastLogin(userId int) error
type PostgresTransaction ¶
type PostgresTransaction struct { PostgresDatabase // contains filtered or unexported fields }
func (*PostgresTransaction) Commit ¶
func (p *PostgresTransaction) Commit() error
func (*PostgresTransaction) Rollback ¶
func (p *PostgresTransaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.