config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config providies ways to retrieve configurations and such from the user's profile.

To use this package correctly one must run

config.SetAppName("myappname")

first which sets the global appName variable.

This value is used to look up application-specific configurations, cache files, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir added in v0.4.4

func CacheDir() (string, error)

CacheDir returns the user's cache dir using appName as suffix.

func Contents added in v0.4.3

func Contents(file string) (io.Reader, error)

Contents returns an io.Reader with the given configuration file contents.

func Dir added in v0.4.4

func Dir() (string, error)

Dir returns the user's config dir using appName as suffix.

func EnvOrContents added in v0.4.3

func EnvOrContents(envar, file string) (io.Reader, error)

EnvOrContents returns the environment variable envar or configuration contents of file.

func SetAppName

func SetAppName(name string)

SetAppName sets the global config app name which is used for retrieving specific configuration contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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