setting

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package setting handles the management of application settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles setting-related operations.

func New

func New(opts Opts) (*Manager, error)

New creates and returns a new instance of the Manager.

func (*Manager) Get

func (m *Manager) Get(key string) (types.JSONText, error)

Get retrieves a setting by key as JSON.

func (*Manager) GetAll

func (m *Manager) GetAll() (models.Settings, error)

GetAll retrieves all settings as a models.Settings struct.

func (*Manager) GetAllJSON

func (m *Manager) GetAllJSON() (types.JSONText, error)

GetAllJSON retrieves all settings as JSON.

func (*Manager) GetAppRootURL

func (m *Manager) GetAppRootURL() (string, error)

GetAppRootURL returns the root URL of the app.

func (*Manager) GetByPrefix

func (m *Manager) GetByPrefix(prefix string) (types.JSONText, error)

GetByPrefix retrieves all settings start with the given prefix.

func (*Manager) Update

func (m *Manager) Update(s any) error

Update updates settings with the passed values.

type Opts

type Opts struct {
	DB            *sqlx.DB
	Lo            *logf.Logger
	EncryptionKey string
}

Opts contains options for initializing the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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