config

package
v0.0.0-...-e289d49 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(cacheDir string, cfg Config) (err error)

WriteConfig writes a configuration file to the given cache directory

Types

type Config

type Config struct {
	DefaultUser              string `json:"default_user"           env:"SAMPCTL_DEFAULT_USER"`                               // the default username for `package init`
	GitHubToken              string `json:"github_token,omitempty" env:"SAMPCTL_GITHUB_TOKEN"`                               // GitHub API token for extended API rate limit
	GitUsername              string `json:"git_username,omitempty" env:"SAMPCTL_GIT_USERNAME"`                               // Git username for private repositories
	GitPassword              string `json:"git_password,omitempty" env:"SAMPCTL_GIT_PASSWORD"`                               // Git password for private repositories
	HideVersionUpdateMessage *bool  `json:"hide_version_update_message,omitempty" env:"SAMPCTL_HIDE_VERSION_UPDATE_MESSAGE"` // Hides the version update message reminder
	CI                       string `json:"-" yaml:"-"             env:"CI"`                                                 // So sampctl can detect if it's running inside GitLab CI/CD or TravisCI
}

Config represents a local configuration for sampctl nolint:lll

func LoadOrCreateConfig

func LoadOrCreateConfig(cacheDir string, verbose bool) (cfg *Config, err error)

LoadOrCreateConfig reads a config file from the given cache directory

Jump to

Keyboard shortcuts

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