/
namespacedingress.go
106 lines (95 loc) · 4.41 KB
/
namespacedingress.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
* MIT License
*
* Copyright (c) since 2021, flomesh.io Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/flomesh-io/fsm-classic/apis/namespacedingress/v1alpha1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// NamespacedIngressLister helps list NamespacedIngresses.
// All objects returned here must be treated as read-only.
type NamespacedIngressLister interface {
// List lists all NamespacedIngresses in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.NamespacedIngress, err error)
// NamespacedIngresses returns an object that can list and get NamespacedIngresses.
NamespacedIngresses(namespace string) NamespacedIngressNamespaceLister
NamespacedIngressListerExpansion
}
// namespacedIngressLister implements the NamespacedIngressLister interface.
type namespacedIngressLister struct {
indexer cache.Indexer
}
// NewNamespacedIngressLister returns a new NamespacedIngressLister.
func NewNamespacedIngressLister(indexer cache.Indexer) NamespacedIngressLister {
return &namespacedIngressLister{indexer: indexer}
}
// List lists all NamespacedIngresses in the indexer.
func (s *namespacedIngressLister) List(selector labels.Selector) (ret []*v1alpha1.NamespacedIngress, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.NamespacedIngress))
})
return ret, err
}
// NamespacedIngresses returns an object that can list and get NamespacedIngresses.
func (s *namespacedIngressLister) NamespacedIngresses(namespace string) NamespacedIngressNamespaceLister {
return namespacedIngressNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// NamespacedIngressNamespaceLister helps list and get NamespacedIngresses.
// All objects returned here must be treated as read-only.
type NamespacedIngressNamespaceLister interface {
// List lists all NamespacedIngresses in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.NamespacedIngress, err error)
// Get retrieves the NamespacedIngress from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.NamespacedIngress, error)
NamespacedIngressNamespaceListerExpansion
}
// namespacedIngressNamespaceLister implements the NamespacedIngressNamespaceLister
// interface.
type namespacedIngressNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all NamespacedIngresses in the indexer for a given namespace.
func (s namespacedIngressNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NamespacedIngress, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.NamespacedIngress))
})
return ret, err
}
// Get retrieves the NamespacedIngress from the indexer for a given namespace and name.
func (s namespacedIngressNamespaceLister) Get(name string) (*v1alpha1.NamespacedIngress, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("namespacedingress"), name)
}
return obj.(*v1alpha1.NamespacedIngress), nil
}