1 Star 0 Fork 0

zhuchance/kubernetes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
results.go 788 Bytes
一键复制 编辑 原始数据 按行查看 历史
package accounts
import (
"strings"
"github.com/rackspace/gophercloud"
)
// GetResult is returned from a call to the Get function.
type GetResult struct {
gophercloud.HeaderResult
}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
// and returns the custom metatdata associated with the account.
func (gr GetResult) ExtractMetadata() (map[string]string, error) {
if gr.Err != nil {
return nil, gr.Err
}
metadata := make(map[string]string)
for k, v := range gr.Header {
if strings.HasPrefix(k, "X-Account-Meta-") {
key := strings.TrimPrefix(k, "X-Account-Meta-")
metadata[key] = v[0]
}
}
return metadata, nil
}
// UpdateResult is returned from a call to the Update function.
type UpdateResult struct {
gophercloud.HeaderResult
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/meoom/kubernetes.git
git@gitee.com:meoom/kubernetes.git
meoom
kubernetes
kubernetes
v0.9.2

搜索帮助

A270a887 8829481 3d7a4017 8829481