本文整理汇总了Golang中cf/configuration.ConfigurationRepository类的典型用法代码示例。如果您正苦于以下问题:Golang ConfigurationRepository类的具体用法?Golang ConfigurationRepository怎么用?Golang ConfigurationRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigurationRepository类的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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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")
}
示例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
}
示例8: NewUAAAuthenticator
func NewUAAAuthenticator(gateway net.Gateway, configRepo configuration.ConfigurationRepository) (uaa UAAAuthenticator) {
uaa.gateway = gateway
uaa.configRepo = configRepo
uaa.config, _ = configRepo.Get()
return
}
示例9: NewUAAAuthenticator
func NewUAAAuthenticator(configRepo configuration.ConfigurationRepository) (uaa UAAAuthenticator) {
uaa.configRepo = configRepo
uaa.config, _ = configRepo.Get()
return
}