config

package
v0.5.35 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Redacted = "*** redacted ***"

Variables

View Source
var (
	Config     = &ProfileT{}
	ConfigFile string
	ConfigDir  string
)

Config points to the current profile

View Source
var GlobalConfig = &struct {
	Profiles       map[string]*ProfileT
	CurrentProfile string
	ModelLocations []string `json:",omitempty"`
}{}

Functions

func CommandInvocation added in v0.5.35

func CommandInvocation() string

func CopyProfile added in v0.4.12

func CopyProfile(sourceName string) error

func DeleteProfile

func DeleteProfile(name string) bool

func ExpandCommandInvocation added in v0.5.35

func ExpandCommandInvocation(s string) string

func GetModelLocations

func GetModelLocations() []string

func IsRunningAsComponent added in v0.5.35

func IsRunningAsComponent() bool

func Load

func Load()

func Migrate added in v0.4.56

func Migrate() error

func RenameProfile

func RenameProfile(name, rename string) error

func RootCommandName added in v0.5.35

func RootCommandName() string

func Save

func Save() error

func SelectProfile

func SelectProfile(name string) bool

func Set

func Set(name, value string) error

func UpdateFromServerProfile

func UpdateFromServerProfile(result *jnode.Node) bool

Types

type LaceworkProfile added in v0.5.35

type LaceworkProfile struct {
	Account   string `toml:"account"`
	APIKey    string `toml:"api_key"`
	APISecret string `toml:"api_secret"`
}

type ProfileT

type ProfileT struct {
	ProfileName         string `json:"-"`
	APIServer           string
	APIToken            string `json:",omitempty"`
	TLSNoVerify         bool   `json:",omitempty"`
	Organization        string
	LaceworkProfileName string           `json:",omitempty"`
	Lacework            *LaceworkProfile `json:"-"`
}

func (*ProfileT) AssertAPITokenFromConfig added in v0.4.33

func (c *ProfileT) AssertAPITokenFromConfig() error

func (*ProfileT) GetAPIServer added in v0.4.33

func (c *ProfileT) GetAPIServer() string

func (*ProfileT) GetAPIToken added in v0.4.33

func (c *ProfileT) GetAPIToken() string

func (*ProfileT) GetAppURL added in v0.4.24

func (c *ProfileT) GetAppURL() string

func (*ProfileT) GetOrganization added in v0.5.35

func (c *ProfileT) GetOrganization() string

func (*ProfileT) SetLaceworkProfile added in v0.5.35

func (c *ProfileT) SetLaceworkProfile(name string)

func (*ProfileT) String

func (c *ProfileT) String() string

Jump to

Keyboard shortcuts

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