Documentation
¶
Index ¶
- Variables
- func DefaultWorkspaceDir(cfg Config) string
- func Dir() string
- func InferSiteURL(apiURL string) string
- func Resolve(path, home string) string
- func SetDefaultDirName(binaryName string)
- func SettingsURL(apiURL string) string
- type Config
- type FilePersister
- type InMemoryPersister
- type Persister
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultDirName is the default name used for config and workspace directories. DefaultDirName string )
Functions ¶
func DefaultWorkspaceDir ¶
DefaultWorkspaceDir provides a sensible default for the Exercism workspace. The default is different depending on the platform, in order to best match the conventions for that platform. It places the directory in the user's home path.
func Dir ¶
func Dir() string
Dir is the configured config home directory. All the cli-related config files live in this directory.
func InferSiteURL ¶
InferSiteURL guesses what the website URL is. The basis for the guess is which API we're submitting to.
Types ¶
type Config ¶
type Config struct { OS string Home string Dir string DefaultBaseURL string DefaultDirName string UserViperConfig *viper.Viper Persister Persister }
Config lets us inject configuration options into commands.
type FilePersister ¶
type FilePersister struct {
Dir string
}
FilePersister saves viper configs to the file system.
type InMemoryPersister ¶
type InMemoryPersister struct{}
InMemoryPersister is a noop persister for use in unit tests.
Source Files
¶
- config.go
- persister.go
- resolve.go
Click to show internal directories.
Click to hide internal directories.