settings

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLocation

func DefaultLocation() (string, error)

DefaultLocation returns the standard location for the settings file

Types

type Settings

type Settings struct {
	Namespace string       `mapstructure:"namespace"` // Currently targeted namespace
	User      string       `mapstructure:"user"`
	Password  string       `mapstructure:"pass"`
	Token     TokenSetting `mapstructure:"token"`
	API       string       `mapstructure:"api"`
	WSS       string       `mapstructure:"wss"`
	Certs     string       `mapstructure:"certs"`
	Colors    bool         `mapstructure:"colors"`
	AppChart  string       `mapstructure:"appchart"` // Current default app chart (name)

	Location string // Origin of data, file which was loaded
	// contains filtered or unexported fields
}

Settings represents a epinio settings

func Load

func Load() (*Settings, error)

Load loads the Epinio settings from the default location

func LoadFrom

func LoadFrom(file string) (*Settings, error)

LoadFrom loads the Epinio settings from a specific file

func (*Settings) Save

func (c *Settings) Save() error

Save saves the Epinio settings

func (*Settings) String

func (c *Settings) String() string

String generates a string representation of the settings (for debugging)

type TokenSetting added in v1.3.0

type TokenSetting struct {
	AccessToken  string    `json:"accesstoken" mapstructure:"accesstoken"`
	TokenType    string    `json:"tokentype,omitempty" mapstructure:"tokentype,omitempty"`
	RefreshToken string    `json:"refreshtoken,omitempty" mapstructure:"refreshtoken,omitempty"`
	Expiry       time.Time `json:"expiry,omitempty" mapstructure:"expiry,omitempty"`
}

Jump to

Keyboard shortcuts

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