Documentation
¶
Index ¶
- Constants
- Variables
- func AppendAllowDNS(projectConfigPath string, entries []string) error
- func AppendAllowHTTP(projectConfigPath string, entries []string) error
- func DefaultGlobalPath() string
- func DefaultProjectPath(projectRoot string) string
- func DetectPresets(projectDir string) []string
- func FindProjectRoot(path string) (string, error)
- func MavenSettings(host string, port int) []byte
- func RandomProxyPort(excluded []int) (int, error)
- func RunFirstTimeSetup(projectDir, projectConfigPath string) ([]string, error)
- func RunReconfigure(projectConfigPath, projectDir string) ([]string, error)
- type Config
- type GlobalConfig
- type MergedConfig
- type ProjectConfig
Constants ¶
const ( RuntimeDirName = "vibepit" CacheDirName = "vibepit" ConfigDirName = "vibepit" ProjectConfigDirName = ".vibepit" )
Variables ¶
var CommitID = "HEAD"
var Version = "0.0.0"
Functions ¶
func AppendAllowDNS ¶
AppendAllowDNS adds entries to the allow-dns list of an existing project config. It loads the current config, deduplicates, and writes back.
func AppendAllowHTTP ¶
AppendAllowHTTP adds entries to the allow-http list of an existing project config. It loads the current config, deduplicates, and writes back.
func DefaultGlobalPath ¶
func DefaultGlobalPath() string
func DefaultProjectPath ¶
func DetectPresets ¶
DetectPresets scans the project root for marker files and returns the names of presets that match. Only presets with Matchers are considered.
func FindProjectRoot ¶
FindProjectRoot returns the Git repository root for the given path, or the path itself if it is not inside a Git repository.
func MavenSettings ¶
func RandomProxyPort ¶
RandomProxyPort returns a random port in the ephemeral range (49152-65535) that is not in the excluded set.
func RunFirstTimeSetup ¶
RunFirstTimeSetup shows an interactive preset selector and writes the project config file. Returns the selected preset names.
func RunReconfigure ¶
RunReconfigure re-runs the interactive preset selector, preserving existing allow-http and allow-dns entries from the project config.
Types ¶
type Config ¶
type Config struct {
Global GlobalConfig
Project ProjectConfig
}
type GlobalConfig ¶
type MergedConfig ¶
type MergedConfig struct {
AllowHTTP []string `json:"allow-http"`
AllowDNS []string `json:"allow-dns"`
BlockCIDR []string `json:"block-cidr"`
AllowCIDR []string `json:"allow-cidr"`
ExtraHosts []string `json:"extra-hosts,omitempty"`
UpstreamDNS string `json:"upstream-dns,omitempty"`
AllowHostPorts []int `json:"allow-host-ports"`
ProxyIP string `json:"proxy-ip,omitempty"`
HostGateway string `json:"host-gateway,omitempty"`
ProxyPort int `json:"proxy-port,omitempty"`
ControlAPIPort int `json:"control-api-port,omitempty"`
SSHForwardAddr string `json:"ssh-forward-addr,omitempty"`
}