mysql

package
v0.0.0-...-1e80c8a Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMysqlRepo

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

FileMysqlRepo ...

func NewFileMetaRepo

func NewFileMetaRepo(db *MySQL) *FileMysqlRepo

NewFileMetaRepo ...

func (*FileMysqlRepo) CreateFileMeta

func (repo *FileMysqlRepo) CreateFileMeta(ctx context.Context, file *model.DBFile) (*model.DBFile, error)

CreateFileMeta creates file in Postgres

func (*FileMysqlRepo) DeleteFileMeta

func (repo *FileMysqlRepo) DeleteFileMeta(ctx context.Context, id uuid.UUID) error

DeleteFileMeta deletes file in Postgres

func (*FileMysqlRepo) GetFileMeta

func (repo *FileMysqlRepo) GetFileMeta(ctx context.Context, id uuid.UUID) (*model.DBFile, error)

GetFileMeta retrieves file from Postgres

func (*FileMysqlRepo) UpdateFileMeta

func (repo *FileMysqlRepo) UpdateFileMeta(ctx context.Context, file *model.DBFile) (*model.DBFile, error)

UpdateFileMeta updates file in Postgres

type MySQL

type MySQL struct {
	*gorm.DB
}

MySQL is a shortcut structure to a mysqldb DB handler

func Dial

func Dial() (*MySQL, error)

Dial creates new database connection to postgres

type UserMysqlRepo

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

UserMysqlRepo ...

func NewUserRepo

func NewUserRepo(db *MySQL) *UserMysqlRepo

NewUserRepo ...

func (*UserMysqlRepo) CreateUser

func (repo *UserMysqlRepo) CreateUser(ctx context.Context, user *model.DBUser) (*model.DBUser, error)

CreateUser creates user in Postgres

func (*UserMysqlRepo) DeleteUser

func (repo *UserMysqlRepo) DeleteUser(ctx context.Context, id uuid.UUID) error

DeleteUser deletes user in Postgres

func (*UserMysqlRepo) GetUser

func (repo *UserMysqlRepo) GetUser(ctx context.Context, id uuid.UUID) (*model.DBUser, error)

GetUser retrieves user from Postgres

func (*UserMysqlRepo) UpdateUser

func (repo *UserMysqlRepo) UpdateUser(ctx context.Context, user *model.DBUser) (*model.DBUser, error)

UpdateUser updates user in Postgres

Jump to

Keyboard shortcuts

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