core_config

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

View Source
const (
	SubjectTypeServiceID = "ServiceId"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsInfo

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

type BXConfigData

type BXConfigData struct {
	APIEndpoint                string
	ConsoleEndpoint            string
	CloudType                  string
	CloudName                  string
	Region                     string
	RegionID                   string
	IAMEndpoint                string
	IAMToken                   string
	IAMRefreshToken            string
	Account                    models.Account
	ResourceGroup              models.ResourceGroup
	LoginAt                    time.Time
	CFEETargeted               bool
	CFEEEnvID                  string
	PluginRepos                []models.PluginRepo
	SSLDisabled                bool
	Locale                     string
	Trace                      string
	ColorEnabled               string
	HTTPTimeout                int
	CLIInfoEndpoint            string
	CheckCLIVersionDisabled    bool
	UsageStatsDisabled         bool
	SDKVersion                 string
	UpdateCheckInterval        time.Duration
	UpdateRetryCheckInterval   time.Duration
	UpdateNotificationInterval time.Duration
	// 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
	LoginAt() time.Time
	IsLoggedIn() bool
	SetLoginAt(loginAt time.Time)
	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
	LoginAt                  time.Time
	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"`
	ID          string       `json:"id"`
	RealmID     string       `json:"realmid"`
	Identifier  string       `json:"identifier"`
	Firstname   string       `json:"given_name"`
	Lastname    string       `json:"family_name"`
	Fullname    string       `json:"name"`
	UserEmail   string       `json:"email"`
	Accounts    AccountsInfo `json:"account"`
	Subject     string       `json:"sub"`
	SubjectType string       `json:"sub_type"`
	Issuer      string       `json:"iss"`
	GrantType   string       `json:"grant_type"`
	Scope       string       `json:"scope"`
	Expiry      time.Time
	IssueAt     time.Time
}

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
	HasTargetedRegion() bool
	IAMToken() string
	IAMRefreshToken() string
	IsLoggedIn() bool
	IsLoggedInWithServiceID() bool
	UserEmail() string
	// UserDisplayText is the human readable ID for logged-in users which include non-human IDs
	UserDisplayText() 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
	UpdateCheckInterval() time.Duration
	UpdateRetryCheckInterval() time.Duration
	UpdateNotificationInterval() time.Duration
	UsageStatsDisabled() bool
	Locale() string
	LoginAt() time.Time
	Trace() string
	ColorEnabled() string
	SDKVersion() string

	UnsetAPI()
	SetAPIEndpoint(string)
	SetConsoleEndpoint(string)
	SetIAMEndpoint(string)
	SetCloudType(string)
	SetCloudName(string)
	SetRegion(models.Region)
	SetIAMToken(string)
	SetIAMRefreshToken(string)
	ClearSession()
	SetAccount(models.Account)
	SetResourceGroup(models.ResourceGroup)
	SetLoginAt(loginAt time.Time)
	SetCheckCLIVersionDisabled(bool)
	SetCLIInfoEndpoint(string)
	SetPluginRepo(models.PluginRepo)
	UnsetPluginRepo(string)
	SetSSLDisabled(bool)
	SetHTTPTimeout(int)
	SetUsageStatsDisabled(bool)
	SetUpdateCheckInterval(time.Duration)
	SetUpdateRetryCheckInterval(time.Duration)
	SetUpdateNotificationInterval(time.Duration)
	SetLocale(string)
	SetTrace(string)
	SetColorEnabled(string)

	CFConfig() CFConfig
	HasTargetedCF() bool
	HasTargetedCFEE() bool
	HasTargetedPublicCF() bool
	SetCFEETargeted(bool)
	CFEEEnvID() string
	SetCFEEEnvID(string)
}

type UAATokenInfo

type UAATokenInfo struct {
	Username string `json:"user_name"`
	Email    string `json:"email"`
	UserGUID string `json:"user_id"`
	Expiry   time.Time
	IssueAt  time.Time
}

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