本文整理匯總了Golang中github.com/dtan4/paus-frontend/store.Etcd.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang Etcd.Get方法的具體用法?Golang Etcd.Get怎麽用?Golang Etcd.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/dtan4/paus-frontend/store.Etcd
的用法示例。
在下文中一共展示了Etcd.Get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Get
func Get(etcd *store.Etcd, username, appName string) (*Healthcheck, error) {
val, err := etcd.Get(etcdKey(username, appName))
if err != nil {
return nil, err
}
var hc Healthcheck
if err := json.Unmarshal([]byte(val), &hc); err != nil {
return nil, err
}
return &hc, nil
}
示例2: URLs
func URLs(etcd *store.Etcd, uriScheme, baseDomain, username, appName string) ([]string, error) {
deployments, err := etcd.List("/paus/users/"+username+"/apps/"+appName+"/deployments/", true)
if err != nil {
return nil, err
}
result := make([]string, 0)
for _, deployment := range deployments {
revision, err := etcd.Get(deployment)
if err != nil {
return nil, err
}
identifier := username + "-" + appName + "-" + revision[0:8]
result = append(result, URL(uriScheme, identifier, baseDomain))
}
return result, nil
}
示例3: GetLoginUser
func GetLoginUser(etcd *store.Etcd, accessToken string) string {
username, _ := etcd.Get("/paus/sessions/" + accessToken)
return username
}
示例4: GetAvaterURL
func GetAvaterURL(etcd *store.Etcd, username string) string {
avaterURL, _ := etcd.Get("/paus/users/" + username + "/avater_url")
return avaterURL
}