Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DirectorySetting = setting.Setting[Directory]{
	Env: "MESHSTACK_CONFIG_DIR",
	Short: func(envKey string) string {
		return fmt.Sprintf("The directory holding profiles.json and one credentials file per profile. Also read from %s.", envKey)
	},
	Long: func(envKey string) string {
		return fmt.Sprintf("The directory holding the meshStack CLI's configuration, also read from `%s`.\n\n"+
			"`profiles.json` describes every profile, and `credentials/<profile>.json` holds that profile's "+
			"credentials and its cached tokens.", envKey)
	},
	Default: setting.DefaultSource(func() (dir string, err error) {

		if dir = os.Getenv("XDG_CONFIG_HOME"); dir == "" {
			if dir, err = os.UserConfigDir(); err != nil {
				return "", fmt.Errorf("cannot locate a configuration directory: %w", err)
			}
		}
		return filepath.Join(dir, "meshstack"), nil
	}),
	Parse: setting.ParseText[Directory],
}

Functions

This section is empty.

Types

type Directory

type Directory string

func (Directory) CredentialsCacheJsonFor

func (d Directory) CredentialsCacheJsonFor(profileName, credentialName fmt.Stringer) string

func (Directory) CredentialsJsonFor

func (d Directory) CredentialsJsonFor(profileName fmt.Stringer) string

func (Directory) Exists

func (d Directory) Exists() bool

func (Directory) Join

func (d Directory) Join(elems ...any) string

func (Directory) ProfilesJson

func (d Directory) ProfilesJson() string

func (Directory) VersionCheckJson

func (d Directory) VersionCheckJson() string

Jump to

Keyboard shortcuts

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