Documentation
¶
Index ¶
Constants ¶
View Source
const ( // File is the default name of the JSON file where the config written. // The user can pass an alternate filename when using the CLI. File = ".exercism.json" // LegacyFile is the name of the original config file. // It is a misnomer, since the config was in json, not go. LegacyFile = ".exercism.go" // DirExercises is the default name of the directory for active users. // Make this non-exported when handlers.Login is deleted. DirExercises = "exercism" )
Variables ¶
This section is empty.
Functions ¶
func Home ¶
Home returns the user's canonical home directory. See: http://stackoverflow.com/questions/7922270/obtain-users-home-directory we can't cross compile using cgo and use user.Current()
Types ¶
type Config ¶
type Config struct {
APIKey string `json:"apiKey"`
Dir string `json:"dir"`
API string `json:"api"`
XAPI string `json:"xapi"`
File string `json:"-"` // full path to config file
// contains filtered or unexported fields
}
Config represents the settings for particular user. This defines both the auth for talking to the API, as well as where to put problems that get downloaded.
func (*Config) IsAuthenticated ¶ added in v1.7.1
IsAuthenticated returns true if the config contains an API key. This does not check whether or not that key is valid.
func (*Config) SetDir ¶
SetDir sets the configuration directory to the given path or defaults to the home exercism directory
Click to show internal directories.
Click to hide internal directories.