core_config

package
v0.0.0-...-84e757a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_PLUGIN_REPO = "Bluemix"
)

Variables

This section is empty.

Functions

func NewCoreConfigFromPath

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

func NewCoreConfigFromPersistor

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

Types

type AccountsInfo

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

type BXConfigData

type BXConfigData struct {
	ConsoleEndpoint         string
	Region                  string
	RegionID                string
	IAMToken                string
	IAMRefreshToken         string
	Account                 models.Account
	PluginRepos             []models.PluginRepo
	Locale                  string
	Trace                   string
	ColorEnabled            string
	HTTPTimeout             int
	CLIInfoEndpoint         string
	CheckCLIVersionDisabled bool
	UsageStatsDisabled      bool
}

func (*BXConfigData) Marshal

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

func (*BXConfigData) Unmarshal

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

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
}

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 {
	Accounts AccountsInfo `json:"account"`
}

func NewIAMTokenInfo

func NewIAMTokenInfo(token string) IAMTokenInfo

type ReadWriter

type ReadWriter interface {
	Reader

	// cf config
	SetAPIVersion(string)
	SetAPIEndpoint(string)
	SetAuthenticationEndpoint(string)
	SetLoggregatorEndpoint(string)
	SetDopplerEndpoint(string)
	SetUAAEndpoint(string)
	SetRoutingAPIEndpoint(string)
	SetSSHOAuthClient(string)
	SetMinCFCLIVersion(string)
	SetMinRecommendedCFCLIVersion(string)

	SetUAAToken(string)
	SetUAARefreshToken(string)

	SetOrganizationFields(models.OrganizationFields)
	SetSpaceFields(models.SpaceFields)

	SetSSLDisabled(bool)
	SetLocale(string)
	SetTrace(string)
	SetColorEnabled(string)

	// bx config
	SetConsoleEndpoint(string)
	SetRegion(string)
	SetRegionID(string)
	SetAccount(models.Account)
	SetIAMToken(string)
	SetIAMRefreshToken(string)
	SetCheckCLIVersionDisabled(bool)
	SetCLIInfoEndpoint(string)
	SetPluginRepo(models.PluginRepo)
	UnSetPluginRepo(string)

	SetHTTPTimeout(int)
	SetUsageStatsDisabled(bool)

	ClearAPIInfo()
	ClearSession()
}

func NewCoreConfig

func NewCoreConfig(errHandler func(error)) ReadWriter

type Reader

type Reader interface {
	// CF config
	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

	OrganizationFields() models.OrganizationFields
	HasOrganization() bool
	SpaceFields() models.SpaceFields
	HasSpace() bool

	IsSSLDisabled() bool
	Locale() string
	Trace() string
	ColorEnabled() string

	// bx config
	ConsoleEndpoint() string
	Region() string
	RegionID() string

	IAMToken() string
	IAMRefreshToken() string
	Account() models.Account
	HasAccount() bool
	IMSAccountID() string

	PluginRepos() []models.PluginRepo
	PluginRepo(string) (models.PluginRepo, bool)
	HTTPTimeout() int
	CLIInfoEndpoint() string
	CheckCLIVersionDisabled() bool
	UsageStatsDisabled() 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