sigs.k8s.io/kueue@v0.6.2/client-go/listers/kueue/v1alpha1/multikueueconfig.go (about)

     1  /*
     2  Copyright The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  // Code generated by lister-gen. DO NOT EDIT.
    17  
    18  package v1alpha1
    19  
    20  import (
    21  	"k8s.io/apimachinery/pkg/api/errors"
    22  	"k8s.io/apimachinery/pkg/labels"
    23  	"k8s.io/client-go/tools/cache"
    24  	v1alpha1 "sigs.k8s.io/kueue/apis/kueue/v1alpha1"
    25  )
    26  
    27  // MultiKueueConfigLister helps list MultiKueueConfigs.
    28  // All objects returned here must be treated as read-only.
    29  type MultiKueueConfigLister interface {
    30  	// List lists all MultiKueueConfigs in the indexer.
    31  	// Objects returned here must be treated as read-only.
    32  	List(selector labels.Selector) (ret []*v1alpha1.MultiKueueConfig, err error)
    33  	// Get retrieves the MultiKueueConfig from the index for a given name.
    34  	// Objects returned here must be treated as read-only.
    35  	Get(name string) (*v1alpha1.MultiKueueConfig, error)
    36  	MultiKueueConfigListerExpansion
    37  }
    38  
    39  // multiKueueConfigLister implements the MultiKueueConfigLister interface.
    40  type multiKueueConfigLister struct {
    41  	indexer cache.Indexer
    42  }
    43  
    44  // NewMultiKueueConfigLister returns a new MultiKueueConfigLister.
    45  func NewMultiKueueConfigLister(indexer cache.Indexer) MultiKueueConfigLister {
    46  	return &multiKueueConfigLister{indexer: indexer}
    47  }
    48  
    49  // List lists all MultiKueueConfigs in the indexer.
    50  func (s *multiKueueConfigLister) List(selector labels.Selector) (ret []*v1alpha1.MultiKueueConfig, err error) {
    51  	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
    52  		ret = append(ret, m.(*v1alpha1.MultiKueueConfig))
    53  	})
    54  	return ret, err
    55  }
    56  
    57  // Get retrieves the MultiKueueConfig from the index for a given name.
    58  func (s *multiKueueConfigLister) Get(name string) (*v1alpha1.MultiKueueConfig, error) {
    59  	obj, exists, err := s.indexer.GetByKey(name)
    60  	if err != nil {
    61  		return nil, err
    62  	}
    63  	if !exists {
    64  		return nil, errors.NewNotFound(v1alpha1.Resource("multikueueconfig"), name)
    65  	}
    66  	return obj.(*v1alpha1.MultiKueueConfig), nil
    67  }