config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteProfile

func DeleteProfile(name string)

DeleteProfile removes a profile from the configuration

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the config file path

func GetCredentials

func GetCredentials() ([]byte, error)

GetCredentials returns the service account credentials JSON

func Init

func Init(cfgFile, profileName string) error

Init initializes the configuration

func IsDebug

func IsDebug() bool

IsDebug returns whether debug mode is enabled

func ListProfiles

func ListProfiles() []string

ListProfiles returns all profile names

func Save

func Save() error

Save saves the current configuration

func SetDebug

func SetDebug(d bool)

SetDebug sets debug mode

func SetDefaultProfile

func SetDefaultProfile(name string)

SetDefaultProfile sets the default profile name

func SetProfile

func SetProfile(p Profile)

SetProfile sets a profile in the configuration

Types

type Config

type Config struct {
	DefaultProfile string             `json:"default_profile"`
	Profiles       map[string]Profile `json:"profiles"`
}

Config represents the playconsole-cli configuration

func GetConfig

func GetConfig() *Config

GetConfig returns the current configuration

type Profile

type Profile struct {
	Name            string `json:"name"`
	CredentialsPath string `json:"credentials_path,omitempty"`
	CredentialsB64  string `json:"credentials_b64,omitempty"`
	DefaultPackage  string `json:"default_package,omitempty"`
}

Profile represents an authentication profile

func GetProfile

func GetProfile() *Profile

GetProfile returns the current profile

Jump to

Keyboard shortcuts

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