config

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Configurazione globale.

Functions

func GetDefaultConfig

func GetDefaultConfig(format string) string

Ritorna il contenuto del file di configurazione di default precedentemente generato. - format: "json", "toml", "yaml"

func Load

func Load(filename string) error

Carica la configurazione da file.

Types

type MySettings

type MySettings struct {
	// Main configuration parameters.
	Main SettingsMain

	// Users list.
	Users []SettingsUserItem
}

func MySettingsDefaults

func MySettingsDefaults() *MySettings

type SettingsMain

type SettingsMain struct {
	ParamSub    SubType
	ParamString string
	ParamBool   bool
	ParamInt    int
	ParamFloat  float64 // Float value, default 1.234
}

type SettingsUserItem

type SettingsUserItem struct {
	Name  string // User name.
	Email string // User e-mail.
}

type SubType added in v1.0.5

type SubType struct {
	ParamMap   map[string]string
	ParamArray []int
}

Sub type example.

Jump to

Keyboard shortcuts

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