Documentation ¶
Index ¶
- Constants
- func Example()
- func ExampleLocalCache()
- func ExampleLocalConfig()
- func ExampleMakePath()
- func ExampleRefresh()
- func ExampleSystemConfig()
- func LocalCache(folder ...string) string
- func LocalConfig(folder ...string) string
- func Refresh()
- func SystemConfig(folder ...string) []string
- type Config
Constants ¶
const ( DefaultNTPAllowedDifference = 50000000 DefaultNTPAllowedNegativeDifference = 50000000 DefaultFileMode = os.FileMode(0755) )
Variables ¶
This section is empty.
Functions ¶
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 ¶
LocalCache returns the local user cache folder, with optional path components added to the end for vendor/application-specific settings.
func LocalConfig ¶
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, checking current environment variables again.
This function is automatically called when the program initializes. If you change the environment variables at run-time, though, you may call the Refresh() function to reevaluate the config paths.
func SystemConfig ¶
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 Logger *log.Config Database *database.Config Webserver *webserver.Config }
func NewConfig ¶
NewConfig will create the Config object and set the default data paths for the application.
func (*Config) CheckConfig ¶
CheckConfig will run private functions to verify the system config, and all subsystem configs are valid
func (*Config) GetDataPath ¶
GetDataPath gets the data path for the given sub-path