本文整理匯總了Golang中camlistore/org/pkg/search.WithAttrRequest.URLSuffix方法的典型用法代碼示例。如果您正苦於以下問題:Golang WithAttrRequest.URLSuffix方法的具體用法?Golang WithAttrRequest.URLSuffix怎麽用?Golang WithAttrRequest.URLSuffix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類camlistore/org/pkg/search.WithAttrRequest
的用法示例。
在下文中一共展示了WithAttrRequest.URLSuffix方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetPermanodesWithAttr
func (c *Client) GetPermanodesWithAttr(req *search.WithAttrRequest) (*search.WithAttrResponse, error) {
sr, err := c.SearchRoot()
if err != nil {
return nil, err
}
url := sr + req.URLSuffix()
hreq := c.newRequest("GET", url)
hres, err := c.expect2XX(hreq)
if err != nil {
return nil, err
}
res := new(search.WithAttrResponse)
if err := httputil.DecodeJSON(hres, res); err != nil {
return nil, err
}
if err := res.Err(); err != nil {
return nil, err
}
return res, nil
}
示例2: GetPermanodesWithAttr
func (c *Client) GetPermanodesWithAttr(req *search.WithAttrRequest) (*search.WithAttrResponse, error) {
sr, err := c.SearchRoot()
if err != nil {
return nil, err
}
url := sr + req.URLSuffix()
hreq := c.newRequest("GET", url)
hres, err := c.doReqGated(hreq)
if err != nil {
return nil, err
}
defer hres.Body.Close()
res := new(search.WithAttrResponse)
if err := json.NewDecoder(hres.Body).Decode(res); err != nil {
return nil, err
}
if err := res.Err(); err != nil {
return nil, err
}
return res, nil
}