config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddApp

func AddApp(cfg *Config, name string) error

AddApp adds an app to the config. Returns an error if the app already exists.

func AddAppWithInstallPath added in v0.3.0

func AddAppWithInstallPath(cfg *Config, name, installPath string) error

AddAppWithInstallPath adds an app with an optional Go package path used for future upgrades. Returns an error if the app already exists.

func DefaultPath

func DefaultPath() string

DefaultPath returns the default config file path (~/.gogitup).

func HasApp

func HasApp(cfg *Config, name string) bool

HasApp checks if an app exists in the config.

func RemoveApp

func RemoveApp(cfg *Config, name string) error

RemoveApp removes an app from the config. Returns an error if the app is not found.

func Save

func Save(path string, cfg *Config) error

Save writes the config to the given file path.

Types

type App

type App struct {
	Name        string `yaml:"name"`
	InstallPath string `yaml:"install_path,omitempty"`
}

App represents a configured application.

type Config

type Config struct {
	Apps       []App  `yaml:"apps"`
	GitHubAuth bool   `yaml:"github_auth"`
	GOPROXY    string `yaml:"goproxy,omitempty"`
	CGOEnabled *bool  `yaml:"cgo_enabled,omitempty"`
}

Config represents the gogitup configuration file.

func Load

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

Load reads and parses the config file at the given path. If the file does not exist, an empty Config is returned without error.

Jump to

Keyboard shortcuts

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