globalconfig

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Env is the environment the CLI is running in
	Env = "DEV"
)
View Source
var GetConfigDir = func() (string, error) {
	homeDir, err := os.UserHomeDir()
	if err != nil {
		return "", err
	}

	return filepath.Join(homeDir, configDir), nil
}

Functions

func SaveGlobalConfig added in v1.4.0

func SaveGlobalConfig(globalConfig GlobalConfig) error

func SetupConfigDir

func SetupConfigDir() error

Types

type Credential added in v1.2.9

type Credential struct {
	Token string `json:"token"`
	ID    string `json:"id"`
	Name  string `json:"name"`
}

type GlobalConfig added in v1.4.0

type GlobalConfig struct {
	OrganizationID string         `json:"organization_id"`
	ProjectID      string         `json:"project_id"`
	Credential     Credential     `json:"credential"`
	KnownProjects  []KnownProject `json:"known_projects"`
	// the following are not saved in json
	CurrRepoKnown bool   `json:"-"` // when true, the current repo and path are already in known_projects
	CurrRepoURL   string `json:"-"`
	CurrRepoPath  string `json:"-"`
}

func GetGlobalConfig added in v1.4.0

func GetGlobalConfig() (GlobalConfig, error)

type KnownProject added in v1.7.0

type KnownProject struct {
	RepoURL        string `json:"repo_url"`
	RepoPath       string `json:"repo_path"`
	OrganizationID string `json:"organization_id"`
	ProjectID      string `json:"project_id"`
}

Jump to

Keyboard shortcuts

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