Documentation
¶
Index ¶
Constants ¶
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" // Host is the default hostname for fetching problems and submitting exercises. // TODO: We need to operate against two hosts (one for problems and one for submissions), // or define a proxy that both APIs can go through. Host = "http://exercism.io" // DirExercises is the default name of the directory for active users. DirExercises = "exercism" )
Variables ¶
This section is empty.
Functions ¶
func DefaultAssignmentPath ¶
func DefaultAssignmentPath() string
DefaultAssignmentPath returns the absolute path of the default exercism directory
func FilePath ¶
FilePath returns the path to the config file.
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()
func HomeDir ¶
func HomeDir() string
HomeDir returns the user's canonical home directory. FIXME: This one will go away. Refactoring in progress.
func ReplaceTilde ¶
ReplaceTilde replaces the short-hand home path with the absolute path.
Types ¶
type Config ¶
type Config struct {
APIKey string `json:"apiKey"`
Dir string `json:"exercismDirectory"`
Hostname string `json:"hostname"`
// 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 New ¶
New returns a new config. It will attempt to set defaults where no value is passed in.
func (*Config) Encode ¶
Encode writes a Config into JSON format.
func (*Config) SavePath ¶
SavePath allows the user to customize the location of the JSON file.
Source Files
¶
- config.go