config

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolName            = "mongocli"      // ToolName of the CLI
	EnvPrefix           = "mcli"          // Prefix for ENV variables
	DefaultProfile      = "default"       // DefaultProfile default
	CloudService        = "cloud"         // CloudService setting when using Atlas API
	CloudManagerService = "cloud-manager" // CloudManagerService settings when using CLoud Manager API
	OpsManagerService   = "ops-manager"   // OpsManagerService settings when using Ops Manager API
	JSON                = "json"          // JSON output format as json

)

Variables

This section is empty.

Functions

func Delete added in v1.1.0

func Delete() error

Delete deletes an existing configuration. The profiles are reloaded afterwards, as this edits the file directly.

func Exists added in v1.1.0

func Exists(name string) bool

Exists returns true if there are any set settings for the profile name.

func GetString

func GetString(name string) string

func IsAccessSet added in v1.1.0

func IsAccessSet() bool

IsAccessSet return true if API keys have been set up. For Ops Manager we also check for the base URL.

func List added in v1.1.0

func List() []string

List returns the names of available profiles

func Load

func Load() error

Load loads the configuration from disk

func Map added in v1.3.0

func Map() map[string]string

Map returns a map describing the configuration.

func Name

func Name() string

func OpsManagerCACertificate added in v1.1.0

func OpsManagerCACertificate() string

OpsManagerCACertificate get configured ops manager CA certificate location

func OpsManagerSkipVerify added in v1.1.0

func OpsManagerSkipVerify() string

SkipVerify get configured ops manager CA certificate location

func OpsManagerURL

func OpsManagerURL() string

OpsManagerURL get configured ops manager base url

func OrgID

func OrgID() string

OrgID get configured organization ID

func Output added in v1.3.0

func Output() string

Output get configured output format

func PrivateAPIKey

func PrivateAPIKey() string

PrivateAPIKey get configured private api key

func ProjectID

func ProjectID() string

ProjectID get configured project ID

func Properties

func Properties() []string

func PublicAPIKey

func PublicAPIKey() string

PublicAPIKey get configured public api key

func Rename added in v1.1.0

func Rename(newProfileName string) error

Rename replaces the Profile to a new Profile name, overwriting any Profile that existed before.

func Save

func Save() error

Save the configuration to disk

func Service

func Service() string

Service get configured service

func Set

func Set(name, value string)

func SetName

func SetName(name string)

func SetOpsManagerURL

func SetOpsManagerURL(v string)

SetOpsManagerURL set configured ops manager base url

func SetOrgID

func SetOrgID(v string)

SetOrgID sets the global organization ID

func SetOutput added in v1.3.0

func SetOutput(v string)

SetOutput sets the global output format

func SetPrivateAPIKey

func SetPrivateAPIKey(v string)

SetPrivateAPIKey set configured private api key

func SetProjectID

func SetProjectID(v string)

SetProjectID sets the global project ID

func SetPublicAPIKey

func SetPublicAPIKey(v string)

SetPublicAPIKey set configured publicAPIKey

func SetService

func SetService(v string)

SetService set configured service

func SortedKeys added in v1.2.0

func SortedKeys() []string

SortedKeys returns the properties of the Profile sorted.

Types

type Profile

type Profile struct {
	// contains filtered or unexported fields
}

func Default added in v1.0.0

func Default() *Profile

func (*Profile) Delete added in v1.3.0

func (p *Profile) Delete() error

func (*Profile) Filename added in v1.3.0

func (p *Profile) Filename() string

func (*Profile) GetString

func (p *Profile) GetString(name string) string

func (*Profile) IsAccessSet added in v1.3.0

func (p *Profile) IsAccessSet() bool

func (*Profile) Load

func (p *Profile) Load(readEnvironmentVars bool) error

func (*Profile) Map added in v1.3.0

func (p *Profile) Map() map[string]string

func (*Profile) Name added in v0.5.0

func (p *Profile) Name() string

func (*Profile) OpsManagerCACertificate added in v1.3.0

func (p *Profile) OpsManagerCACertificate() string

func (*Profile) OpsManagerSkipVerify added in v1.3.0

func (p *Profile) OpsManagerSkipVerify() string

func (*Profile) OpsManagerURL

func (p *Profile) OpsManagerURL() string

func (*Profile) OrgID

func (p *Profile) OrgID() string

func (*Profile) Output added in v1.3.0

func (p *Profile) Output() string

func (*Profile) PrivateAPIKey

func (p *Profile) PrivateAPIKey() string

func (*Profile) ProjectID

func (p *Profile) ProjectID() string

func (*Profile) PublicAPIKey

func (p *Profile) PublicAPIKey() string

func (*Profile) Rename added in v1.3.0

func (p *Profile) Rename(newProfileName string) error

func (*Profile) Save

func (p *Profile) Save() error

func (*Profile) Service

func (p *Profile) Service() string

func (*Profile) Set

func (p *Profile) Set(name, value string)

func (*Profile) SetName

func (p *Profile) SetName(name string)

func (*Profile) SetOpsManagerURL

func (p *Profile) SetOpsManagerURL(v string)

func (*Profile) SetOrgID

func (p *Profile) SetOrgID(v string)

func (*Profile) SetOutput added in v1.3.0

func (p *Profile) SetOutput(v string)

func (*Profile) SetPrivateAPIKey

func (p *Profile) SetPrivateAPIKey(v string)

func (*Profile) SetProjectID

func (p *Profile) SetProjectID(v string)

func (*Profile) SetPublicAPIKey

func (p *Profile) SetPublicAPIKey(v string)

func (*Profile) SetService

func (p *Profile) SetService(v string)

func (*Profile) SortedKeys added in v1.3.0

func (p *Profile) SortedKeys() []string

type Saver added in v1.0.0

type Saver interface {
	Save() error
}

type SetSaver added in v1.0.0

type SetSaver interface {
	Setter
	Saver
}

type Setter added in v1.0.0

type Setter interface {
	Set(string, string)
}

Jump to

Keyboard shortcuts

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