config

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCLIConfigPath added in v0.5.0

func GetCLIConfigPath() (string, error)

GetCLIConfigPath returns the path to the CLI config file

func SaveCLIConfig added in v0.5.0

func SaveCLIConfig(config *CLIConfig) error

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

func LoadCLIConfig() (*CLIConfig, error)

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

func (c *CLIConfig) ShouldCheckForUpdate() bool

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

func FindConfig() (string, *Config, error)

FindConfig looks for vers.toml in the current directory or parent directories

func LoadConfig

func LoadConfig(path string) (*Config, error)

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

type MetaConfig struct {
	Project string `toml:"project"`
	Type    string `toml:"type"`
}

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)
}

UpdateCheckConfig holds update checking state

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL