本文整理汇总了Golang中github.com/rackspace/gophercloud.AuthOptions.Username方法的典型用法代码示例。如果您正苦于以下问题:Golang AuthOptions.Username方法的具体用法?Golang AuthOptions.Username怎么用?Golang AuthOptions.Username使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/rackspace/gophercloud.AuthOptions
的用法示例。
在下文中一共展示了AuthOptions.Username方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: OnlyRS
// OnlyRS overrides the default Gophercloud behavior of using OS_-prefixed environment variables
// if RS_ variables aren't present. Otherwise, they'll stomp over each other here in the acceptance
// tests, where you need to have both defined.
func OnlyRS(original gophercloud.AuthOptions) gophercloud.AuthOptions {
if os.Getenv("RS_AUTH_URL") == "" {
original.IdentityEndpoint = ""
}
if os.Getenv("RS_USERNAME") == "" {
original.Username = ""
}
if os.Getenv("RS_PASSWORD") == "" {
original.Password = ""
}
if os.Getenv("RS_API_KEY") == "" {
original.APIKey = ""
}
return original
}