mysqldb

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create() dbrepo.Repository

Types

type MysqlRepository

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

func (*MysqlRepository) Close

func (r *MysqlRepository) Close()

func (*MysqlRepository) CreateTemplate

func (r *MysqlRepository) CreateTemplate(ctx context.Context, tpl *entity.Template) error

func (*MysqlRepository) DeleteTemplate

func (r *MysqlRepository) DeleteTemplate(ctx context.Context, uuid string, permanent bool) error

Note: The DeleteTemplate function does not really delete a database entry. Rather it sets the 'deleted_at' timestamp, which results it not being found on the get/update queries. This could be useful for some sort of "Archive" in the Dashboard for the Admins to restore deleted templates or as some sort of Backup.

func (*MysqlRepository) GetTemplateByCid

func (r *MysqlRepository) GetTemplateByCid(ctx context.Context, cid string, lang string) (*entity.Template, error)

func (*MysqlRepository) GetTemplateById

func (r *MysqlRepository) GetTemplateById(ctx context.Context, id string) (*entity.Template, error)

func (*MysqlRepository) GetTemplates

func (r *MysqlRepository) GetTemplates(ctx context.Context) ([]*entity.Template, error)

func (*MysqlRepository) Migrate

func (r *MysqlRepository) Migrate() error

func (*MysqlRepository) Open

func (r *MysqlRepository) Open() error

func (*MysqlRepository) UpdateTemplate

func (r *MysqlRepository) UpdateTemplate(ctx context.Context, uuid string, data *entity.Template) error

Jump to

Keyboard shortcuts

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