settings

package
v0.0.0-...-e4caca2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDriver

func AddDriver(driver Interface)

func All

func All() map[string]generic.Value

func DriverName

func DriverName() string

func Drivers

func Drivers() map[string]Interface

func Get

func Get(key string) generic.Value

func Has

func Has(key string) (bool, generic.Value)

func Init

func Init(params ...string) error

func Register

func Register(settings ...interface{})

func Set

func Set(key string, value interface{}) error

func SetDefaultDriver

func SetDefaultDriver(driver Interface)

func SetMulti

func SetMulti(data map[string]interface{}) error

Types

type Interface

type Interface interface {
	// Name returns driver name
	Name() string
	Get(key string) generic.Value
	Has(key string) (bool, generic.Value)
	All() map[string]generic.Value
	Set(key string, value interface{}) error
	SetMulti(data map[string]interface{}) error
	Register(settings ...interface{}) error
	Init(params ...string) error
}

func Driver

func Driver(driver string) (Interface, bool)

func Use

func Use(driver string) Interface

type Setting

type Setting struct {
	Domain      string `gorm:"column:domain;primaryKey" json:"domain"`
	Name        string `gorm:"column:name;primaryKey" json:"name"`
	Title       string `gorm:"column:title" json:"title"`
	Description string `gorm:"column:description" json:"description"`
	Value       string `gorm:"column:value" json:"value"`
	Type        string `gorm:"column:type" json:"type"`
	Params      string `gorm:"column:params" json:"params"`
	ReadOnly    bool   `gorm:"column:read_only" json:"read_only"`
	Visible     bool   `gorm:"column:visible" json:"visible"`
}

type SettingDomain

type SettingDomain struct {
	DomainID    int    `gorm:"column:domain_id;primaryKey" json:"domain_id"`
	Title       string `gorm:"column:title" json:"title"`
	Description string `gorm:"column:description" json:"description"`
	Domain      string `gorm:"column:domain" json:"domain"`
	ReadOnly    bool   `gorm:"column:read_only" json:"read_only"`
	Visible     bool   `gorm:"column:visible" json:"visible"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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