當前位置: 首頁>>代碼示例>>Golang>>正文


Golang gophercloud.BuildQueryString函數代碼示例

本文整理匯總了Golang中github.com/rackspace/gophercloud.BuildQueryString函數的典型用法代碼示例。如果您正苦於以下問題:Golang BuildQueryString函數的具體用法?Golang BuildQueryString怎麽用?Golang BuildQueryString使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BuildQueryString函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ToObjectGetQuery

// ToObjectGetQuery formats a GetOpts into a query string.
func (opts GetOpts) ToObjectGetQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:CorainChicago,項目名稱:gophercloud,代碼行數:8,代碼來源:requests.go

示例2: ToResourceEventListQuery

// ToResourceEventListQuery formats a ListResourceEventsOpts into a query string.
func (opts ListResourceEventsOpts) ToResourceEventListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:Clarifai,項目名稱:kubernetes,代碼行數:8,代碼來源:requests.go

示例3: ToMeterStatisticsQuery

// ToMeterStatisticsQuery formats a StatisticsOpts into a query string.
func (opts MeterStatisticsOpts) ToMeterStatisticsQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:dudymas,項目名稱:gophercloud,代碼行數:8,代碼來源:requests.go

示例4: ToPortListQuery

// ToPortListQuery formats a ListOpts into a query string.
func (opts ListOpts) ToPortListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:feiskyer,項目名稱:gophercloud,代碼行數:8,代碼來源:requests.go

示例5: ToContainerListParams

// ToContainerListParams formats a ListOpts into a query string and boolean
// representing whether to list complete information for each container.
func (opts ListOpts) ToContainerListParams() (bool, string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return false, "", err
	}
	return false, q.String(), nil
}
開發者ID:Clarifai,項目名稱:kubernetes,代碼行數:9,代碼來源:delegate.go

示例6: ToRolesListAssignmentsQuery

// ToRolesListAssignmentsQuery formats a ListAssignmentsOpts into a query string.
func (opts ListAssignmentsOpts) ToRolesListAssignmentsQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:Clarifai,項目名稱:kubernetes,代碼行數:8,代碼來源:requests.go

示例7: ToShowQuery

// ToMeterShowQuery formats a ShowOpts into a query string.
func (opts ShowOpts) ToShowQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:rackspace,項目名稱:gophercloud,代碼行數:8,代碼來源:requests.go

示例8: ToObjectListParams

// ToObjectListParams formats a ListOpts into a query string and boolean
// representing whether to list complete information for each object.
func (opts ListOpts) ToObjectListParams() (bool, string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return false, "", err
	}
	return opts.Full, q.String(), nil
}
開發者ID:CorainChicago,項目名稱:gophercloud,代碼行數:9,代碼來源:requests.go

示例9: ToCDNAssetDeleteParams

// ToCDNAssetDeleteParams formats a DeleteOpts into a query string.
func (opts DeleteOpts) ToCDNAssetDeleteParams() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
開發者ID:Clarifai,項目名稱:kubernetes,代碼行數:8,代碼來源:requests.go

示例10: GetDataByResolution

// GetDataByPoints retrieve metric data by resolution, for the specified tenant associated with RackspaceMetrics.
func GetDataByResolution(c *gophercloud.ServiceClient, metric string, opts QueryParams) GetResult {
	var res GetResult

	url := getURLForResolution(c, metric)
	query, _ := gophercloud.BuildQueryString(opts)
	url += query.String()
	_, res.Err = c.Get(url, &res.Body, nil)
	return res
}
開發者ID:goru97,項目名稱:Metrics_GO,代碼行數:10,代碼來源:requests.go

示例11: List

// List returns a Pager which allows you to iterate over a collection of
// routers. It accepts a ListOpts struct, which allows you to filter and sort
// the returned collection for greater efficiency.
//
// Default policy settings return only those routers that are owned by the
// tenant who submits the request, unless an admin user submits the request.
func List(c *gophercloud.ServiceClient, opts ListOpts) pagination.Pager {
	q, err := gophercloud.BuildQueryString(&opts)
	if err != nil {
		return pagination.Pager{Err: err}
	}
	u := rootURL(c) + q.String()
	return pagination.NewPager(c, u, func(r pagination.PageResult) pagination.Page {
		return RouterPage{pagination.LinkedPageBase{PageResult: r}}
	})
}
開發者ID:hortonworks,項目名稱:kubernetes-yarn,代碼行數:16,代碼來源:requests.go

示例12: ToObjectDownloadParams

// ToObjectDownloadParams formats a DownloadOpts into a query string and map of
// headers.
func (opts DownloadOpts) ToObjectDownloadParams() (map[string]string, string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return nil, "", err
	}
	h, err := gophercloud.BuildHeaders(opts)
	if err != nil {
		return nil, q.String(), err
	}
	return h, q.String(), nil
}
開發者ID:CorainChicago,項目名稱:gophercloud,代碼行數:13,代碼來源:requests.go

示例13: List

// List enumerates the services available to a specific user.
func List(client *gophercloud.ServiceClient, opts ListOpts) pagination.Pager {
	u := listURL(client)
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return pagination.Pager{Err: err}
	}
	u += q.String()
	createPage := func(r pagination.PageResult) pagination.Page {
		return ServicePage{pagination.LinkedPageBase{PageResult: r}}
	}

	return pagination.NewPager(client, u, createPage)
}
開發者ID:rtgoodwin,項目名稱:cs-reboot-info,代碼行數:14,代碼來源:requests.go

示例14: SearchMetric

// SearchMetric retrieves a list of available metrics for the specified tenant associated with RackspaceMetrics.
func SearchMetric(c *gophercloud.ServiceClient, opts QueryParams) ([]Metric, error) {
	var res GetResult

	url := getSearchURL(c)
	query, _ := gophercloud.BuildQueryString(opts)
	url += query.String()

	_, res.Err = c.Get(url, &res.Body, nil)
	b := res.Body.(interface{})
	var metrics []Metric
	err := mapstructure.Decode(b, &metrics)
	return metrics, err
}
開發者ID:goru97,項目名稱:Metrics_GO,代碼行數:14,代碼來源:requests.go

示例15: GetEvents

//GetEvents retrieves a list of events for the specified tenant associated with RackspaceMetrics.
func GetEvents(c *gophercloud.ServiceClient, opts QueryParams) ([]Event, error) {
	var res GetResult

	url := getEventURL(c)
	query, _ := gophercloud.BuildQueryString(opts)
	url += query.String()

	_, res.Err = c.Get(url, &res.Body, nil)
	b := res.Body.(interface{})
	var events []Event
	err := mapstructure.Decode(b, &events)
	return events, err
}
開發者ID:goru97,項目名稱:Metrics_GO,代碼行數:14,代碼來源:requests.go


注:本文中的github.com/rackspace/gophercloud.BuildQueryString函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。