config

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config provides global app config object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobalConfig

type GlobalConfig interface {
	launchr.Service
	// DirPath returns an absolute path to config directory.
	DirPath() string
	// Path provides an absolute path to global config.
	Path(parts ...string) string
	// EnsurePath creates all directories in the path.
	EnsurePath(parts ...string) error
	// Get returns a value by name to a parameter v. Parameter v must be a pointer to a value.
	// Error may be returned on decode.
	Get(name string, v interface{}) error
}

GlobalConfig is a config interface.

func GlobalConfigFromFS

func GlobalConfigFromFS(root fs.FS) GlobalConfig

GlobalConfigFromFS parses global app config.

type GlobalConfigAware

type GlobalConfigAware interface {
	// SetGlobalConfig sets a global config to the struct.
	SetGlobalConfig(GlobalConfig)
}

GlobalConfigAware provides an interface for structs to support global configuration setting.

Jump to

Keyboard shortcuts

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