configuration

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDirPath

func ConfigDirPath() string

func HomeDirPath

func HomeDirPath(subdir string) (string, error)

Types

type ConfigFile

type ConfigFile struct {
	FileName   string
	FileFormat string
	Properties []Property
	ViperStore *viper.Viper
}

func (ConfigFile) Clear

func (c ConfigFile) Clear()

func (ConfigFile) Init

func (c ConfigFile) Init()

func (ConfigFile) LoadConfig

func (c ConfigFile) LoadConfig()

func (ConfigFile) Save

func (c ConfigFile) Save()

type ConfigLocations

type ConfigLocations struct {
	ConfigPath string
}

func NewConfigLocations

func NewConfigLocations() *ConfigLocations

type ConfigProperty

type ConfigProperty[T any] struct {
	DefaultValue T
	KeyName      string
	ViperStore   *viper.Viper
}

func (ConfigProperty[T]) Clear

func (c ConfigProperty[T]) Clear()

func (ConfigProperty[T]) Get

func (c ConfigProperty[T]) Get() T

func (ConfigProperty[T]) Init

func (c ConfigProperty[T]) Init()

func (ConfigProperty[T]) Set

func (c ConfigProperty[T]) Set(value T)

type MarshaledProperty

type MarshaledProperty[T any] struct {
	DefaultValue *T
	KeyName      string
	ViperStore   *viper.Viper
}

func (MarshaledProperty[T]) Clear

func (c MarshaledProperty[T]) Clear()

func (MarshaledProperty[T]) Get

func (c MarshaledProperty[T]) Get() T

func (MarshaledProperty[T]) Init

func (c MarshaledProperty[T]) Init()

func (MarshaledProperty[T]) Set

func (c MarshaledProperty[T]) Set(value *T)

type Property

type Property interface {
	Init()
	Clear()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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