本文整理汇总了Golang中github.com/innotech/hydra/vendors/github.com/coreos/etcd/server.Server.URL方法的典型用法代码示例。如果您正苦于以下问题:Golang Server.URL方法的具体用法?Golang Server.URL怎么用?Golang Server.URL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/innotech/hydra/vendors/github.com/coreos/etcd/server.Server
的用法示例。
在下文中一共展示了Server.URL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: testRenewLock
func testRenewLock(s *server.Server, key string, index string, value string, ttl int) (string, int, error) {
resp, err := tests.PutForm(fmt.Sprintf("%s/mod/v2/lock/%s?index=%s&value=%s&ttl=%d", s.URL(), key, index, value, ttl), nil)
ret := tests.ReadBody(resp)
return string(ret), resp.StatusCode, err
}
示例2: testReleaseLock
func testReleaseLock(s *server.Server, key string, index string, value string) (string, int, error) {
resp, err := tests.DeleteForm(fmt.Sprintf("%s/mod/v2/lock/%s?index=%s&value=%s", s.URL(), key, index, value), nil)
ret := tests.ReadBody(resp)
return string(ret), resp.StatusCode, err
}
示例3: testDeleteLeader
func testDeleteLeader(s *server.Server, key string, name string) (string, int, error) {
resp, err := tests.DeleteForm(fmt.Sprintf("%s/mod/v2/leader/%s?name=%s", s.URL(), key, name), nil)
ret := tests.ReadBody(resp)
return string(ret), resp.StatusCode, err
}
示例4: testGetLockValue
func testGetLockValue(s *server.Server, key string) (string, int, error) {
resp, err := tests.Get(fmt.Sprintf("%s/mod/v2/lock/%s", s.URL(), key))
ret := tests.ReadBody(resp)
return string(ret), resp.StatusCode, err
}
示例5: testSetLeader
func testSetLeader(s *server.Server, key string, name string, ttl int) (string, int, error) {
resp, err := tests.PutForm(fmt.Sprintf("%s/mod/v2/leader/%s?name=%s&ttl=%d", s.URL(), key, name, ttl), nil)
ret := tests.ReadBody(resp)
return string(ret), resp.StatusCode, err
}