setting

package
v0.0.0-...-f171045 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func NewRepository

func NewRepository(db *gorm.DB) *Repository

func (Repository) Create

func (r Repository) Create(setting Setting) (Setting, error)

func (Repository) CreateOrUpdate

func (r Repository) CreateOrUpdate(code string, value string) (Setting, error)

func (Repository) GetValue

func (r Repository) GetValue(code string) (value string, err error)

type RepositoryContract

type RepositoryContract interface {
	Create(setting Setting) (Setting, error)
	CreateOrUpdate(code string, value string) (Setting, error)
	GetValue(code string) (value string, err error)
}

type Setting

type Setting struct {
	ID    uint   `gorm:"primary_key"`
	Code  string `gorm:"type:varchar(100);uniqueIndex;not null"`
	Value string `gorm:"type:text"`
}

Jump to

Keyboard shortcuts

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