settings_old

package
v2.0.0-...-4e8a7ef Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 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 ...any) error

func Set

func Set(key string, value any) error

func SetDefaultDriver

func SetDefaultDriver(driver Interface)

func SetMulti

func SetMulti(data map[string]any) error

Types

type Interface

type Interface interface {
	Name() string                         // Name returns driver name
	Get(key string) generic.Value         // Get returns single value
	Has(key string) (bool, generic.Value) // Has check if key exists
	All() map[string]generic.Value        // All returns all of configuration values
	Set(key string, value any) error      // Set sets value of a key
	SetMulti(data map[string]any) error   // SetMulti sets multiple keys at once
	Register(settings ...any) error       // Register a new key to be used in the future
	Init(params ...string) error          // Init will be called at the initialization of application
}

func Driver

func Driver(driver string) (Interface, bool)

func Use

func Use(driver string) Interface

type Setting

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

type SettingDomain

type SettingDomain struct {
	DomainID    uint   `json:"domain_id"`
	Domain      string `json:"domain"`
	Title       string `json:"title"`
	Description string `json:"description"`
	ReadOnly    bool   `json:"read_only"`
	Visible     bool   `json:"visible"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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