config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 7 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

)

Variables

This section is empty.

Functions

func GetString

func GetString(name string) string

func Load

func Load() error

Load loads the configuration from disk

func Name

func Name() string

func OpsManagerURL

func OpsManagerURL() string

OpsManagerURL get configured ops manager base url

func OrgID

func OrgID() string

OrgID get configured organization ID

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 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 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

Types

type Profile

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

func New

func New() *Profile

func (*Profile) GetString

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

func (*Profile) Load

func (p *Profile) Load() error

func (*Profile) Name added in v0.5.0

func (p *Profile) Name() string

func (*Profile) OpsManagerURL

func (p *Profile) OpsManagerURL() string

func (*Profile) OrgID

func (p *Profile) OrgID() 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) 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) 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)

type ProfileSaver added in v0.5.0

type ProfileSaver interface {
	Save() error
}

type ProfileSetSaver added in v0.5.0

type ProfileSetSaver interface {
	ProfileSetter
	ProfileSaver
}

func Config added in v0.5.0

func Config() ProfileSetSaver

type ProfileSetter added in v0.5.0

type ProfileSetter interface {
	Set(string, string)
}

Jump to

Keyboard shortcuts

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