config

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMustLogin = fmt.Errorf("error retrieving auth information. Try logging in via 'nucleus login'")
)

Functions

func ClearNucleusAuthFile

func ClearNucleusAuthFile() error

func DoesNucleusConfigExist

func DoesNucleusConfigExist() bool

func GetOrCreateNucleusFolder

func GetOrCreateNucleusFolder() (string, error)

Get or Creates the Nucleus folder that lives and stores persisted settings.

1. Checks for directory specified by env var NUCLEUS_CONFIG_DIR 2. Checks for existence of XDG_CONFIG_HOME and append "nucleus" to it, if exists 3. Use ~/.nucleus

func SetNucleusAuthFile

func SetNucleusAuthFile(authConfig NucleusAuthConfig) error

func SetNucleusConfig

func SetNucleusConfig(config *NucleusConfig) error

Sets the nucleus config defined by the user

Types

type NucleusAuthConfig

type NucleusAuthConfig struct {
	AccessToken  string `yaml:"accessToken"`
	RefreshToken string `yaml:"refreshToken,omitempty"`
	IdToken      string `yaml:"idToken,omitempty"`
}

func GetNucleusAuthConfig

func GetNucleusAuthConfig() (*NucleusAuthConfig, error)

Gets the nucleus auth config

type NucleusConfig

type NucleusConfig struct {
	CliVersion string     `yaml:"cliVersion"`
	Spec       SpecStruct `yaml:"spec"`
}

func GetNucleusConfig

func GetNucleusConfig() (*NucleusConfig, error)

Retrieves the nucleus config defined by the user

type NucleusSecrets

type NucleusSecrets = map[string]map[string]string

type ResourceList

type ResourceList struct {
	Cpu    string `yaml:"cpu,omitempty"`
	Memory string `yaml:"memory,omitempty"`
}

type ResourceRequirements

type ResourceRequirements struct {
	Minimum ResourceList `yaml:"minimum,omitempty"`
	Maximum ResourceList `yaml:"maximum,omitempty"`
}

type SpecStruct

type SpecStruct struct {
	ServiceName        string               `yaml:"serviceName"`
	ServiceRunTime     string               `yaml:"serviceRuntime"`
	Image              string               `yaml:"image,omitempty"`
	IsPrivate          bool                 `yaml:"isPrivate"`
	Vars               map[string]string    `yaml:"vars,omitempty"`
	Secrets            NucleusSecrets       `yaml:"secrets,omitempty"`
	AllowedServices    []string             `yaml:"allowedServices,omitempty"`
	DisallowedServices []string             `yaml:"disallowedServices,omitempty"`
	Resources          ResourceRequirements `yaml:"resources,omitempty"`
}

Jump to

Keyboard shortcuts

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