config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNTPAllowedDifference         = 50000000
	DefaultNTPAllowedNegativeDifference = 50000000
	DefaultFileMode                     = os.FileMode(0755)
)

Variables

This section is empty.

Functions

func Example

func Example()

Example quick start example for a common use case of this module.

func ExampleLocalCache

func ExampleLocalCache()

ExampleLocalCache example for getting a user-specific cache folder.

func ExampleLocalConfig

func ExampleLocalConfig()

ExampleLocalConfig example for getting a user-specific configuration path.

func ExampleMakePath

func ExampleMakePath()

ExampleMakePath example for automatically creating config directories.

func ExampleRefresh

func ExampleRefresh()

ExampleRefresh example for recalculating what the directories should be.

func ExampleSystemConfig

func ExampleSystemConfig()

ExampleSystemConfig example for getting a global system configuration path.

func LocalCache

func LocalCache(folder ...string) string

LocalCache returns the local user cache folder, with optional path components added to the end for vendor/application-specific settings.

func LocalConfig

func LocalConfig(folder ...string) string

LocalConfig returns the local user configuration path, with optional path components added to the end for vendor/application-specific settings.

func Refresh

func Refresh()

Refresh will rediscover the config paths

func SystemConfig

func SystemConfig(folder ...string) []string

SystemConfig returns the system-wide configuration paths, with optional path components added to the end for vendor/application-specific settings.

Types

type Config

type Config struct {
	ConfigDir       string
	GoMaxProcessors int
	LogConfig       *log.Config
	DatabaseConfig  *database.Config
	WebserverConfig *webserver.Config
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig will create the Config object and set the default data paths for the application.

func (*Config) GetDataPath

func (c *Config) GetDataPath(elem ...string) string

GetDataPath gets the data path for the given sub-path

func (*Config) SaveConfig

func (c *Config) SaveConfig() error

Jump to

Keyboard shortcuts

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