Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultBaseDir = "." DefaultFolders = "config,../config" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location interface { // AddFolder // adds a folder to the location manager. Config files will be searched // in this folder. // // config.Location.Add("config") AddFolder(folders ...string) Location // Find // finds a config file in located folders. // // config.Location.Find("app.json") // config.Location.Find("app.yaml", "app.yml") Find(names ...string) (resource resource.Resource) // GetBaseDir // returns the base directory of the application. // // return "./" // return "/data/sketch" GetBaseDir() (dir string) // GetFolders // returns the list of folders. // // return []string{ // "./config", // "../config", // } GetFolders() (list []string) // SetBaseDir // sets the base directory of the application. // // config.Location.SetBaseDir("./") // config.Location.SetBaseDir("/data/sketch") SetBaseDir(dir string) Location // SetFolders // sets the list of folders. Override the previous list. // // config.Location.SetFolders([]string{ // "./config", // "../config", // }) SetFolders(folders ...string) Location }
Location is an interface for user operators.
Click to show internal directories.
Click to hide internal directories.