Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCLIConfigPath ¶ added in v0.5.0
GetCLIConfigPath returns the path to the CLI config file
func SaveCLIConfig ¶ added in v0.5.0
SaveCLIConfig saves the CLI configuration to ~/.vers/config.json
Types ¶
type BuildConfig ¶
type BuildConfig struct {
Builder string `toml:"builder"`
BuildCommand string `toml:"build_command"`
}
BuildConfig holds build configuration
type CLIConfig ¶ added in v0.5.0
type CLIConfig struct {
UpdateCheck UpdateCheckConfig `json:"update_check"`
}
CLIConfig represents the global CLI configuration stored in ~/.vers/config.json
func LoadCLIConfig ¶ added in v0.5.0
LoadCLIConfig loads the CLI configuration from ~/.vers/config.json
func (*CLIConfig) SetNextCheckTime ¶ added in v0.5.0
func (c *CLIConfig) SetNextCheckTime()
SetNextCheckTime sets the next check time based on the interval
func (*CLIConfig) ShouldCheckForUpdate ¶ added in v0.5.0
ShouldCheckForUpdate returns true if it's time to check for updates
type Config ¶
type Config struct {
Meta MetaConfig `toml:"meta"`
Build BuildConfig `toml:"build"`
Deploy DeployConfig `toml:"deploy"`
Run RunConfig `toml:"run"`
Env map[string]string `toml:"env"`
Machine map[string]MachineConfig `toml:"machine"`
}
Config represents the structure of vers.toml
func FindConfig ¶
FindConfig looks for vers.toml in the current directory or parent directories
func LoadConfig ¶
LoadConfig loads the vers.toml configuration file
type DeployConfig ¶
type DeployConfig struct {
Platform string `toml:"platform"`
}
DeployConfig holds deployment configuration
type MachineConfig ¶
type MachineConfig struct {
Name string `toml:"name"`
Image string `toml:"image"`
IP string `toml:"ip"`
Port string `toml:"port"`
}
MachineConfig holds configuration for a specific machine
type MetaConfig ¶
MetaConfig holds project metadata
type RunConfig ¶
type RunConfig struct {
Command string `toml:"command"`
EntryPoints []string `toml:"entry_points"`
}
RunConfig holds runtime configuration
type UpdateCheckConfig ¶ added in v0.5.0
type UpdateCheckConfig struct {
LastCheck time.Time `json:"last_check"`
NextCheck time.Time `json:"next_check"`
CheckInterval int64 `json:"check_interval"` // in seconds, default 3600 (1 hour)
// LatestVersion is the most recently observed upstream release tag
// (e.g. "v0.10.0"). Cached so the "update available" nag can be
// printed synchronously on subsequent runs without hitting the network.
LatestVersion string `json:"latest_version,omitempty"`
}
UpdateCheckConfig holds update checking state