core_config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package core_config provides functions to load core configuration. The package is for internal only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsInfo

type AccountsInfo struct {
	AccountID    string `json:"bss"`
	IMSAccountID string `json:"ims"`
}

type BXConfigData

type BXConfigData struct {
	APIEndpoint             string
	ConsoleEndpoint         string
	Region                  string
	RegionID                string
	RegionType              string
	IAMEndpoint             string
	IAMToken                string
	IAMRefreshToken         string
	Account                 models.Account
	ResourceGroup           models.ResourceGroup
	PluginRepos             []models.PluginRepo
	SSLDisabled             bool
	Locale                  string
	Trace                   string
	ColorEnabled            string
	HTTPTimeout             int
	CLIInfoEndpoint         string
	CheckCLIVersionDisabled bool
	UsageStatsDisabled      bool
	SDKVersion              string
	// contains filtered or unexported fields
}

func NewBXConfigData

func NewBXConfigData() *BXConfigData

func (*BXConfigData) Marshal

func (data *BXConfigData) Marshal() ([]byte, error)

func (*BXConfigData) Unmarshal

func (data *BXConfigData) Unmarshal(bytes []byte) error

type CFConfig

type CFConfig interface {
	APIVersion() string
	APIEndpoint() string
	HasAPIEndpoint() bool
	AuthenticationEndpoint() string
	UAAEndpoint() string
	LoggregatorEndpoint() string
	DopplerEndpoint() string
	RoutingAPIEndpoint() string
	SSHOAuthClient() string
	MinCFCLIVersion() string
	MinRecommendedCFCLIVersion() string
	Username() string
	UserGUID() string
	UserEmail() string
	IsLoggedIn() bool
	UAAToken() string
	UAARefreshToken() string
	CurrentOrganization() models.OrganizationFields
	HasTargetedOrganization() bool
	CurrentSpace() models.SpaceFields
	HasTargetedSpace() bool

	UnsetAPI()
	SetAPIVersion(string)
	SetAPIEndpoint(string)
	SetAuthenticationEndpoint(string)
	SetLoggregatorEndpoint(string)
	SetDopplerEndpoint(string)
	SetUAAEndpoint(string)
	SetRoutingAPIEndpoint(string)
	SetSSHOAuthClient(string)
	SetMinCFCLIVersion(string)
	SetMinRecommendedCFCLIVersion(string)
	SetUAAToken(string)
	SetUAARefreshToken(string)
	SetOrganization(models.OrganizationFields)
	SetSpace(models.SpaceFields)
	ClearSession()
}

type CFConfigData

type CFConfigData struct {
	ConfigVersion            int
	Target                   string
	APIVersion               string
	AuthorizationEndpoint    string
	LoggregatorEndpoint      string
	DopplerEndpoint          string
	UaaEndpoint              string
	RoutingAPIEndpoint       string
	AccessToken              string
	RefreshToken             string
	UAAOAuthClient           string
	UAAOAuthClientSecret     string
	SSHOAuthClient           string
	OrganizationFields       models.OrganizationFields
	SpaceFields              models.SpaceFields
	SSLDisabled              bool
	AsyncTimeout             uint
	Trace                    string
	ColorEnabled             string
	Locale                   string
	PluginRepos              []models.PluginRepo
	MinCLIVersion            string
	MinRecommendedCLIVersion string
	// contains filtered or unexported fields
}

func NewCFConfigData

func NewCFConfigData() *CFConfigData

func (*CFConfigData) Marshal

func (data *CFConfigData) Marshal() ([]byte, error)

func (*CFConfigData) Unmarshal

func (data *CFConfigData) Unmarshal(bytes []byte) error

type IAMTokenInfo

type IAMTokenInfo struct {
	IAMID       string       `json:"iam_id"`
	UserEmail   string       `json:"email"`
	Accounts    AccountsInfo `json:"account"`
	Subject     string       `json:"sub"`
	SubjectType string       `json:"sub_type"`
}

func NewIAMTokenInfo

func NewIAMTokenInfo(token string) IAMTokenInfo

type ReadWriter

type ReadWriter interface {
	Repository
}

Deprecated

func NewCoreConfig

func NewCoreConfig(errHandler func(error)) ReadWriter

func NewCoreConfigFromPath

func NewCoreConfigFromPath(cfConfigPath string, bxConfigPath string, errHandler func(error)) ReadWriter

func NewCoreConfigFromPersistor

func NewCoreConfigFromPersistor(cfPersistor configuration.Persistor, bxPersistor configuration.Persistor, errHandler func(error)) ReadWriter

type Repository

type Repository interface {
	APIEndpoint() string
	HasAPIEndpoint() bool
	ConsoleEndpoint() string
	IAMEndpoint() string
	CloudName() string
	CloudType() string
	CurrentRegion() models.Region
	IAMToken() string
	IAMRefreshToken() string
	IsLoggedIn() bool
	UserEmail() string
	IAMID() string
	CurrentAccount() models.Account
	HasTargetedAccount() bool
	IMSAccountID() string
	CurrentResourceGroup() models.ResourceGroup
	HasTargetedResourceGroup() bool
	PluginRepos() []models.PluginRepo
	PluginRepo(string) (models.PluginRepo, bool)
	IsSSLDisabled() bool
	HTTPTimeout() int
	CLIInfoEndpoint() string
	CheckCLIVersionDisabled() bool
	UsageStatsDisabled() bool
	Locale() string
	Trace() string
	ColorEnabled() string
	SDKVersion() string

	UnsetAPI()
	SetAPIEndpoint(string)
	SetConsoleEndpoint(string)
	SetIAMEndpoint(string)
	SetRegion(models.Region)
	SetIAMToken(string)
	SetIAMRefreshToken(string)
	ClearSession()
	SetAccount(models.Account)
	SetResourceGroup(models.ResourceGroup)
	SetCheckCLIVersionDisabled(bool)
	SetCLIInfoEndpoint(string)
	SetPluginRepo(models.PluginRepo)
	UnsetPluginRepo(string)
	SetSSLDisabled(bool)
	SetHTTPTimeout(int)
	SetUsageStatsDisabled(bool)
	SetLocale(string)
	SetTrace(string)
	SetColorEnabled(string)

	CFConfig() CFConfig
	HasTargetedCF() bool
}

type UAATokenInfo

type UAATokenInfo struct {
	Username string `json:"user_name"`
	Email    string `json:"email"`
	UserGUID string `json:"user_id"`
}

func NewUAATokenInfo

func NewUAATokenInfo(token string) UAATokenInfo

Jump to

Keyboard shortcuts

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