config

package
v0.5.49 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

View Source
var (
	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 LoadLaceworkProfiles added in v0.5.36

func LoadLaceworkProfiles(configFile string)

func Migrate added in v0.4.56

func Migrate() error

func RenameProfile

func RenameProfile(name, rename string) error

func Reset added in v0.5.36

func Reset()

Reset loaded configuration to unloaded

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

Types

type LaceworkProfile added in v0.5.35

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

func GetDefaultLaceworkProfile added in v0.5.36

func GetDefaultLaceworkProfile() *LaceworkProfile

func GetLaceworkProfiles added in v0.5.36

func GetLaceworkProfiles() (result []*LaceworkProfile)

type ProfileT

type ProfileT struct {
	ProfileName         string `json:"-"`
	APIServer           string
	APIToken            string `json:",omitempty"`
	TLSNoVerify         bool   `json:",omitempty"`
	Organization        string
	LaceworkProfileName string `json:",omitempty"`
	// ConfiguredAccount is the account that this profile was configured for.
	// It is set when `iac configure` runs. The need for this is non-obvious:
	// the (IAC) Organzation is tied to an account, so if the account was switched
	// (e.g. running lacework switch-profile) then the Organization is no longer
	// correct.
	ConfiguredAccount string `json:",omitempty"`
	// contains filtered or unexported fields
}

func Get added in v0.5.39

func Get() *ProfileT

func (*ProfileT) GetLaceworkProfile added in v0.5.36

func (c *ProfileT) GetLaceworkProfile() *LaceworkProfile

func (*ProfileT) PrintableJSON added in v0.5.38

func (c *ProfileT) PrintableJSON() *jnode.Node

func (*ProfileT) Reset added in v0.5.42

func (c *ProfileT) Reset()

func (*ProfileT) SetLaceworkProfile added in v0.5.35

func (c *ProfileT) SetLaceworkProfile(name string) error

Jump to

Keyboard shortcuts

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