settings

package
v0.0.0-...-baca4c3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service contains the code for safely (using a Mutex) getting and updating settings.

func NewService

func NewService(store datastore.Store) (*Service, error)

NewService initialises and returns a new SettingsService

func (*Service) Get

func (s *Service) Get() Settings

Get returns the loaded settings.

func (*Service) Set

func (s *Service) Set(settings Settings) error

Set saves updates settings, if saving fails restore the current values.

type Settings

type Settings struct {
	Tenant TenantSettings `yaml:"tenant"`
}

Settings contains the Mattrax's dynamic configuration. These values can be changed at runtime although it is recommended some of them never change.

func (Settings) Verify

func (settings Settings) Verify() error

Verify checks the Settings are valid. This is done prior to saving updated settings.

type TenantSettings

type TenantSettings struct {
	Name               string `yaml:"name"`
	SupportEmail       string `yaml:"support_email"`
	SupportPhone       string `yaml:"support_phone"`
	SupportWebsite     string `yaml:"support_website"`
	EnrollmentDisabled bool   `yaml:"enrollment_disabled"`
}

TenantSettings contains details about the server's owner Some of these settings show up on the device to tell a end user where to contact for help.

Jump to

Keyboard shortcuts

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