當前位置: 首頁>>代碼示例>>Golang>>正文


Golang ConfigurationRepository.Get方法代碼示例

本文整理匯總了Golang中cf/configuration.ConfigurationRepository.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang ConfigurationRepository.Get方法的具體用法?Golang ConfigurationRepository.Get怎麽用?Golang ConfigurationRepository.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cf/configuration.ConfigurationRepository的用法示例。


在下文中一共展示了ConfigurationRepository.Get方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: NewAuthenticate

func NewAuthenticate(ui terminal.UI, configRepo configuration.ConfigurationRepository, authenticator api.AuthenticationRepository) (cmd Authenticate) {
	cmd.ui = ui
	cmd.configRepo = configRepo
	cmd.config, _ = configRepo.Get()
	cmd.authenticator = authenticator
	return
}
開發者ID:nsnt,項目名稱:cli,代碼行數:7,代碼來源:authenticate.go

示例2: NewTarget

func NewTarget(ui term.UI, configRepo configuration.ConfigurationRepository, orgRepo api.OrganizationRepository, spaceRepo api.SpaceRepository) (t Target) {
	t.ui = ui
	t.configRepo = configRepo
	t.config, _ = configRepo.Get()
	t.orgRepo = orgRepo
	t.spaceRepo = spaceRepo

	return
}
開發者ID:KaiYoung,項目名稱:cli,代碼行數:9,代碼來源:target.go

示例3: NewLogin

func NewLogin(ui term.UI, configRepo configuration.ConfigurationRepository, orgRepo api.OrganizationRepository, spaceRepo api.SpaceRepository, authenticator api.Authenticator) (l Login) {
	l.ui = ui
	l.configRepo = configRepo
	l.config, _ = configRepo.Get()
	l.orgRepo = orgRepo
	l.spaceRepo = spaceRepo
	l.authenticator = authenticator
	return
}
開發者ID:KaiYoung,項目名稱:cli,代碼行數:9,代碼來源:login.go

示例4: NewTarget

func NewTarget(ui terminal.UI,
	configRepo configuration.ConfigurationRepository,
	orgRepo api.OrganizationRepository,
	spaceRepo api.SpaceRepository) (cmd Target) {

	cmd.ui = ui
	cmd.configRepo = configRepo
	cmd.config, _ = configRepo.Get()
	cmd.orgRepo = orgRepo
	cmd.spaceRepo = spaceRepo

	return
}
開發者ID:jalateras,項目名稱:cli,代碼行數:13,代碼來源:target.go

示例5: loadConfig

func loadConfig(termUI terminal.UI, configRepo configuration.ConfigurationRepository) (config *configuration.Configuration) {
	config, err := configRepo.Get()
	if err != nil {
		termUI.Failed(fmt.Sprintf(
			"Error loading config. Please reset target (%s) and log in (%s).",
			terminal.CommandColor(fmt.Sprintf("%s target", cf.Name())),
			terminal.CommandColor(fmt.Sprintf("%s login", cf.Name())),
		))
		configRepo.Delete()
		os.Exit(1)
		return
	}
	return
}
開發者ID:jalateras,項目名稱:cli,代碼行數:14,代碼來源:cf.go

示例6: testRefreshToken

func testRefreshToken(t *testing.T, configRepo configuration.ConfigurationRepository, gateway Gateway) {
	config, err := configRepo.Get()
	assert.NoError(t, err)

	request, err := gateway.NewRequest("POST", config.Target+"/v2/foo", config.AccessToken, strings.NewReader("expected body"))
	assert.NoError(t, err)

	err = gateway.PerformRequest(request)
	assert.NoError(t, err)

	savedConfig := testhelpers.SavedConfiguration
	assert.Equal(t, savedConfig.AccessToken, "bearer new-access-token")
	assert.Equal(t, savedConfig.RefreshToken, "new-refresh-token")
}
開發者ID:jbayer,項目名稱:cli,代碼行數:14,代碼來源:gateway_test.go

示例7: NewLogin

func NewLogin(ui terminal.UI,
	configRepo configuration.ConfigurationRepository,
	authenticator api.AuthenticationRepository,
	endpointRepo api.EndpointRepository,
	orgRepo api.OrganizationRepository,
	spaceRepo api.SpaceRepository) (cmd Login) {

	cmd.ui = ui
	cmd.configRepo = configRepo
	cmd.config, _ = configRepo.Get()
	cmd.authenticator = authenticator
	cmd.endpointRepo = endpointRepo
	cmd.orgRepo = orgRepo
	cmd.spaceRepo = spaceRepo

	return
}
開發者ID:nsnt,項目名稱:cli,代碼行數:17,代碼來源:login.go

示例8: NewUAAAuthenticator

func NewUAAAuthenticator(gateway net.Gateway, configRepo configuration.ConfigurationRepository) (uaa UAAAuthenticator) {
	uaa.gateway = gateway
	uaa.configRepo = configRepo
	uaa.config, _ = configRepo.Get()
	return
}
開發者ID:jbayer,項目名稱:cli,代碼行數:6,代碼來源:authentication.go

示例9: NewUAAAuthenticator

func NewUAAAuthenticator(configRepo configuration.ConfigurationRepository) (uaa UAAAuthenticator) {
	uaa.configRepo = configRepo
	uaa.config, _ = configRepo.Get()
	return
}
開發者ID:KaiYoung,項目名稱:cli,代碼行數:5,代碼來源:authentication.go


注:本文中的cf/configuration.ConfigurationRepository.Get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。