Documentation ¶
Overview ¶
Package config manages global CLI configuration.
Index ¶
Constants ¶
View Source
const Filename = "config.toml"
Filename is the name of the application configuration file.
Variables ¶
View Source
var Path = func() string { if dir, err := os.UserConfigDir(); err == nil { return filepath.Join(dir, "fastly", Filename) } if dir, err := os.UserHomeDir(); err == nil { return filepath.Join(dir, ".fastly", Filename) } panic("unable to deduce user config dir or user home dir") }()
Path is the location of the application configuration file.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
Version string `toml:"version"`
}
CLI represents CLI specific configuration.
type Data ¶
type Data struct { // ConfigVersion is the version of the configuration schema. ConfigVersion int `toml:"config_version"` // Fastly represents fastly specific configuration. Fastly Fastly `toml:"fastly"` // Language represents C@E language specific configuration. Language Language `toml:"language"` // Profiles represents multiple profile accounts. Profiles Profiles `toml:"profile"` // StarterKits represents language specific starter kits. StarterKits StarterKitLanguages `toml:"starter-kits"` // Viceroy represents viceroy specific configuration. Viceroy Viceroy `toml:"viceroy"` }
Data represents our application toml configuration.
type Fastly ¶
type Fastly struct {
APIEndpoint string `toml:"api_endpoint"`
}
Fastly represents fastly specific configuration.
type Go ¶
type Go struct { // TinyGoConstraint is the `tinygo` version that we support. TinyGoConstraint string `toml:"tinygo_constraint"` // ToolchainConstraint is the `go` version that we support. // // We aim for go versions that support go modules by default. // https://go.dev/blog/using-go-modules ToolchainConstraint string `toml:"toolchain_constraint"` }
Go represents Go C@E language specific configuration.
type Profile ¶
type Profile struct { Default bool `toml:"default" json:"default"` Email string `toml:"email" json:"email"` Token string `toml:"token" json:"token"` }
Profile represents a specific profile account.
type Rust ¶
type Rust struct { // ToolchainConstraint is the `rustup` toolchain constraint for the compiler // that we support (a range is expected, e.g. >= 1.49.0 < 2.0.0). ToolchainConstraint string `toml:"toolchain_constraint"` // WasmWasiTarget is the Rust compilation target for Wasi capable Wasm. WasmWasiTarget string `toml:"wasm_wasi_target"` }
Rust represents Rust C@E language specific configuration.
type StarterKit ¶
type StarterKit struct { Name string `toml:"name"` Description string `toml:"description"` Path string `toml:"path"` Tag string `toml:"tag"` Branch string `toml:"branch"` }
StarterKit represents starter kit specific configuration.
type StarterKitLanguages ¶
type StarterKitLanguages struct { AssemblyScript []StarterKit `toml:"assemblyscript"` Go []StarterKit `toml:"go"` JavaScript []StarterKit `toml:"javascript"` Rust []StarterKit `toml:"rust"` }
StarterKitLanguages represents language specific starter kits.
type Viceroy ¶
type Viceroy struct { // LastChecked is when the version of Viceroy was last checked. LastChecked string `toml:"last_checked"` // LatestVersion is the latest Viceroy version at the time it is set. LatestVersion string `toml:"latest_version"` // TTL is how long the CLI waits before considering the version stale. TTL string `toml:"ttl"` }
Viceroy represents viceroy specific configuration.
Click to show internal directories.
Click to hide internal directories.