inmemorydb

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create() dbrepo.Repository

Types

type InmemoryRepository

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

func (*InmemoryRepository) Close

func (r *InmemoryRepository) Close()

func (*InmemoryRepository) CreateTemplate

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

func (*InmemoryRepository) DeleteTemplate

func (r *InmemoryRepository) 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 (*InmemoryRepository) GetTemplateByCid

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

func (*InmemoryRepository) GetTemplateById

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

func (*InmemoryRepository) GetTemplates

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

func (*InmemoryRepository) Migrate

func (r *InmemoryRepository) Migrate() error

func (*InmemoryRepository) Open

func (r *InmemoryRepository) Open() error

func (*InmemoryRepository) UpdateTemplate

func (r *InmemoryRepository) 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