• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang pagination.SinglePageBase函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/rackspace/gophercloud/pagination.SinglePageBase函数的典型用法代码示例。如果您正苦于以下问题:Golang SinglePageBase函数的具体用法?Golang SinglePageBase怎么用?Golang SinglePageBase使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了SinglePageBase函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: ListNodesDetails

// ListNodesDetails returns all load balancer pool nodes that are associated with RackConnect
// for the given LB pool ID with all their details.
func ListNodesDetails(c *gophercloud.ServiceClient, id string) pagination.Pager {
	url := listNodesDetailsURL(c, id)
	createPage := func(r pagination.PageResult) pagination.Page {
		return NodeDetailsPage{pagination.SinglePageBase(r)}
	}
	return pagination.NewPager(c, url, createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:9,代码来源:requests.go


示例2: List

// List members returns list of members for specifed image id
// More details: http://developer.openstack.org/api-ref-image-v2.html#listImageMembers-v2
func List(client *gophercloud.ServiceClient, id string) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return MemberPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, listMembersURL(client, id), createPage)
}
开发者ID:rackspace,项目名称:gophercloud,代码行数:9,代码来源:requests.go


示例3: List

// List returns a Pager which allows you to iterate over the full collection of extensions.
// It does not accept query parameters.
func List(c *gophercloud.ServiceClient) pagination.Pager {
	return common.List(c).WithPageCreator(func(r pagination.PageResult) pagination.Page {
		return ExtensionPage{
			ExtensionPage: common.ExtensionPage{SinglePageBase: pagination.SinglePageBase(r)},
		}
	})
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:9,代码来源:delegate.go


示例4: List

// List is the operation responsible for returning a paginated collection of
// network items that define a load balancer's access list.
func List(client *gophercloud.ServiceClient, lbID int) pagination.Pager {
	url := rootURL(client, lbID)

	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
		return AccessListPage{pagination.SinglePageBase(r)}
	})
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:9,代码来源:requests.go


示例5: List

func List(client *gophercloud.ServiceClient) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return UserPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, rootURL(client), createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:7,代码来源:requests.go


示例6: List

// List returns a Pager which allows you to iterate over a collection of
// networks. It accepts a ListOpts struct, which allows you to filter and sort
// the returned collection for greater efficiency.
func List(c *gophercloud.ServiceClient, instanceID string) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return VirtualInterfacePage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(c, listURL(c, instanceID), createPage)
}
开发者ID:rtgoodwin,项目名称:cs-reboot-info,代码行数:10,代码来源:requests.go


示例7: List

// List will list all of the available configurations.
func List(client *gophercloud.ServiceClient) pagination.Pager {
	pageFn := func(r pagination.PageResult) pagination.Page {
		return ConfigPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, baseURL(client), pageFn)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:8,代码来源:requests.go


示例8: Create

// Create is the operation responsible for creating a new node on a load
// balancer. Since every load balancer exists in both ServiceNet and the public
// Internet, both private and public IP addresses can be used for nodes.
//
// If nodes need time to boot up services before they become operational, you
// can temporarily prevent traffic from being sent to that node by setting the
// Condition field to DRAINING. Health checks will still be performed; but once
// your node is ready, you can update its condition to ENABLED and have it
// handle traffic.
func Create(client *gophercloud.ServiceClient, loadBalancerID int, opts CreateOptsBuilder) CreateResult {
	var res CreateResult

	reqBody, err := opts.ToNodeCreateMap()
	if err != nil {
		res.Err = err
		return res
	}

	resp, err := client.Request("POST", rootURL(client, loadBalancerID), gophercloud.RequestOpts{
		JSONBody:     &reqBody,
		JSONResponse: &res.Body,
		OkCodes:      []int{202},
	})
	if err != nil {
		res.Err = err
		return res
	}

	pr, err := pagination.PageResultFrom(resp)
	if err != nil {
		res.Err = err
		return res
	}

	return CreateResult{pagination.SinglePageBase(pr)}
}
开发者ID:rtgoodwin,项目名称:cs-reboot-info,代码行数:36,代码来源:requests.go


示例9: commonList

func commonList(client *gophercloud.ServiceClient, url string) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return SecurityGroupPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, url, createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:7,代码来源:requests.go


示例10: ListForServer

// ListForServer returns all public IPs for the server with the given serverID.
func ListForServer(c *gophercloud.ServiceClient, serverID string) pagination.Pager {
	url := listForServerURL(c, serverID)
	createPage := func(r pagination.PageResult) pagination.Page {
		return PublicIPPage{pagination.SinglePageBase(r)}
	}
	return pagination.NewPager(c, url, createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:8,代码来源:requests.go


示例11: List

// List returns a Pager which allows you to iterate over a collection of
// networks. It accepts a ListOpts struct, which allows you to filter and sort
// the returned collection for greater efficiency.
func List(c *gophercloud.ServiceClient) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return NetworkPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(c, listURL(c), createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:10,代码来源:requests.go


示例12: List

// List returns a single page of CDN flavors.
func List(c *gophercloud.ServiceClient) pagination.Pager {
	url := listURL(c)
	createPage := func(r pagination.PageResult) pagination.Page {
		return FlavorPage{pagination.SinglePageBase(r)}
	}
	return pagination.NewPager(c, url, createPage)
}
开发者ID:rtgoodwin,项目名称:cs-reboot-info,代码行数:8,代码来源:requests.go


示例13: ListRoles

func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager {
	createPage := func(r pagination.PageResult) pagination.Page {
		return RolePage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, listRolesURL(client, tenantID, userID), createPage)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:7,代码来源:requests.go


示例14: List

// List returns all scaling policies for a group.
func List(client *gophercloud.ServiceClient, groupID string) pagination.Pager {
	url := listURL(client, groupID)

	createPageFn := func(r pagination.PageResult) pagination.Page {
		return PolicyPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, url, createPageFn)
}
开发者ID:sstrato,项目名称:gophercloud,代码行数:10,代码来源:requests.go


示例15: ListTypes

// ListTypes makes a request against the API to list resource types.
func ListTypes(client *gophercloud.ServiceClient) pagination.Pager {
	url := listTypesURL(client)

	createPageFn := func(r pagination.PageResult) pagination.Page {
		return ResourceTypePage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, url, createPageFn)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:10,代码来源:requests.go


示例16: List

// List is the operation responsible for returning a paginated collection of
// load balancer nodes. It requires the node ID, its parent load balancer ID,
// and optional limit integer (passed in either as a pointer or a nil poitner).
func List(client *gophercloud.ServiceClient, loadBalancerID int, limit *int) pagination.Pager {
	url := rootURL(client, loadBalancerID)
	if limit != nil {
		url += fmt.Sprintf("?limit=%d", limit)
	}

	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
		return NodePage{pagination.SinglePageBase(r)}
	})
}
开发者ID:johndmulhausen,项目名称:kubernetes,代码行数:13,代码来源:requests.go


示例17: List

// List returns Volumes optionally limited by the conditions provided in ListOpts.
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := listURL(client)
	if opts != nil {
		query, err := opts.ToVolumeListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	createPage := func(r pagination.PageResult) pagination.Page {
		return ListResult{pagination.SinglePageBase(r)}
	}
	return pagination.NewPager(client, url, createPage)
}
开发者ID:hortonworks,项目名称:kubernetes-yarn,代码行数:15,代码来源:requests.go


示例18: ListEvents

// ListEvents is the operation responsible for listing all the events
// associated with the activity between the node and the load balancer. The
// events report errors found with the node. The detailedMessage provides the
// detailed reason for the error.
func ListEvents(client *gophercloud.ServiceClient, loadBalancerID int, opts ListEventsOptsBuilder) pagination.Pager {
	url := eventsURL(client, loadBalancerID)

	if opts != nil {
		query, err := opts.ToEventsListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}

	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
		return NodeEventPage{pagination.SinglePageBase(r)}
	})
}
开发者ID:johndmulhausen,项目名称:kubernetes,代码行数:19,代码来源:requests.go


示例19: List

// List will list all the saved backups for all database instances.
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := baseURL(client)

	if opts != nil {
		query, err := opts.ToBackupListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}

	pageFn := func(r pagination.PageResult) pagination.Page {
		return BackupPage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, url, pageFn)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:18,代码来源:requests.go


示例20: List

// List makes a request against the API to list resources for the given stack.
func List(client *gophercloud.ServiceClient, stackName, stackID string, opts ListOptsBuilder) pagination.Pager {
	url := listURL(client, stackName, stackID)

	if opts != nil {
		query, err := opts.ToStackResourceListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}

	createPageFn := func(r pagination.PageResult) pagination.Page {
		return ResourcePage{pagination.SinglePageBase(r)}
	}

	return pagination.NewPager(client, url, createPageFn)
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:18,代码来源:requests.go



注:本文中的github.com/rackspace/gophercloud/pagination.SinglePageBase函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang rackspace.AuthenticatedClient函数代码示例发布时间:2022-05-28
下一篇:
Golang pagination.NewPager函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap