1
0
mirror of https://github.com/rancher/types.git synced 2025-09-17 07:19:17 +00:00

Updated go generate

This commit is contained in:
rawmind0
2020-02-10 19:11:56 +01:00
parent ba0e239c51
commit 713d4e8c3c
111 changed files with 1998 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ type APIServiceClient struct {
type APIServiceOperations interface {
List(opts *types.ListOpts) (*APIServiceCollection, error)
ListAll(opts *types.ListOpts) (*APIServiceCollection, error)
Create(opts *APIService) (*APIService, error)
Update(existing *APIService, updates interface{}) (*APIService, error)
Replace(existing *APIService) (*APIService, error)
@@ -100,6 +101,23 @@ func (c *APIServiceClient) List(opts *types.ListOpts) (*APIServiceCollection, er
return resp, err
}
func (c *APIServiceClient) ListAll(opts *types.ListOpts) (*APIServiceCollection, error) {
resp := &APIServiceCollection{}
resp, err := c.List(opts)
if err != nil {
return resp, err
}
data := resp.Data
for resp, err = resp.Next(); resp != nil && err == nil; resp, err = resp.Next() {
data = append(data, resp.Data...)
}
if err != nil {
return resp, err
}
resp.Data = data
return resp, err
}
func (cc *APIServiceCollection) Next() (*APIServiceCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &APIServiceCollection{}

View File

@@ -54,6 +54,7 @@ type NamespaceClient struct {
type NamespaceOperations interface {
List(opts *types.ListOpts) (*NamespaceCollection, error)
ListAll(opts *types.ListOpts) (*NamespaceCollection, error)
Create(opts *Namespace) (*Namespace, error)
Update(existing *Namespace, updates interface{}) (*Namespace, error)
Replace(existing *Namespace) (*Namespace, error)
@@ -94,6 +95,23 @@ func (c *NamespaceClient) List(opts *types.ListOpts) (*NamespaceCollection, erro
return resp, err
}
func (c *NamespaceClient) ListAll(opts *types.ListOpts) (*NamespaceCollection, error) {
resp := &NamespaceCollection{}
resp, err := c.List(opts)
if err != nil {
return resp, err
}
data := resp.Data
for resp, err = resp.Next(); resp != nil && err == nil; resp, err = resp.Next() {
data = append(data, resp.Data...)
}
if err != nil {
return resp, err
}
resp.Data = data
return resp, err
}
func (cc *NamespaceCollection) Next() (*NamespaceCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &NamespaceCollection{}

View File

@@ -110,6 +110,7 @@ type PersistentVolumeClient struct {
type PersistentVolumeOperations interface {
List(opts *types.ListOpts) (*PersistentVolumeCollection, error)
ListAll(opts *types.ListOpts) (*PersistentVolumeCollection, error)
Create(opts *PersistentVolume) (*PersistentVolume, error)
Update(existing *PersistentVolume, updates interface{}) (*PersistentVolume, error)
Replace(existing *PersistentVolume) (*PersistentVolume, error)
@@ -148,6 +149,23 @@ func (c *PersistentVolumeClient) List(opts *types.ListOpts) (*PersistentVolumeCo
return resp, err
}
func (c *PersistentVolumeClient) ListAll(opts *types.ListOpts) (*PersistentVolumeCollection, error) {
resp := &PersistentVolumeCollection{}
resp, err := c.List(opts)
if err != nil {
return resp, err
}
data := resp.Data
for resp, err = resp.Next(); resp != nil && err == nil; resp, err = resp.Next() {
data = append(data, resp.Data...)
}
if err != nil {
return resp, err
}
resp.Data = data
return resp, err
}
func (cc *PersistentVolumeCollection) Next() (*PersistentVolumeCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &PersistentVolumeCollection{}

View File

@@ -56,6 +56,7 @@ type StorageClassClient struct {
type StorageClassOperations interface {
List(opts *types.ListOpts) (*StorageClassCollection, error)
ListAll(opts *types.ListOpts) (*StorageClassCollection, error)
Create(opts *StorageClass) (*StorageClass, error)
Update(existing *StorageClass, updates interface{}) (*StorageClass, error)
Replace(existing *StorageClass) (*StorageClass, error)
@@ -94,6 +95,23 @@ func (c *StorageClassClient) List(opts *types.ListOpts) (*StorageClassCollection
return resp, err
}
func (c *StorageClassClient) ListAll(opts *types.ListOpts) (*StorageClassCollection, error) {
resp := &StorageClassCollection{}
resp, err := c.List(opts)
if err != nil {
return resp, err
}
data := resp.Data
for resp, err = resp.Next(); resp != nil && err == nil; resp, err = resp.Next() {
data = append(data, resp.Data...)
}
if err != nil {
return resp, err
}
resp.Data = data
return resp, err
}
func (cc *StorageClassCollection) Next() (*StorageClassCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &StorageClassCollection{}