sigs.k8s.io/cluster-api-provider-aws@v1.5.5/pkg/cloud/scope/getters.go (about)

     1  /*
     2  Copyright 2018 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  
    17  package scope
    18  
    19  var (
    20  	// DefaultClusterScopeGetter defines the default cluster scope getter.
    21  	DefaultClusterScopeGetter ClusterScopeGetter = ClusterScopeGetterFunc(NewClusterScope)
    22  
    23  	// DefaultMachineScopeGetter defines the default machine scope getter.
    24  	DefaultMachineScopeGetter MachineScopeGetter = MachineScopeGetterFunc(NewMachineScope)
    25  )
    26  
    27  // ClusterScopeGetter defines the cluster scope getter interface.
    28  type ClusterScopeGetter interface {
    29  	ClusterScope(params ClusterScopeParams) (*ClusterScope, error)
    30  }
    31  
    32  // ClusterScopeGetterFunc defines handler types for cluster scope getters.
    33  type ClusterScopeGetterFunc func(params ClusterScopeParams) (*ClusterScope, error)
    34  
    35  // ClusterScope will return the cluster scope.
    36  func (f ClusterScopeGetterFunc) ClusterScope(params ClusterScopeParams) (*ClusterScope, error) {
    37  	return f(params)
    38  }
    39  
    40  // MachineScopeGetter defines the machine scope getter interface.
    41  type MachineScopeGetter interface {
    42  	MachineScope(params MachineScopeParams) (*MachineScope, error)
    43  }
    44  
    45  // MachineScopeGetterFunc defines handler types for machine scope getters.
    46  type MachineScopeGetterFunc func(params MachineScopeParams) (*MachineScope, error)
    47  
    48  // MachineScope will return the machine scope.
    49  func (f MachineScopeGetterFunc) MachineScope(params MachineScopeParams) (*MachineScope, error) {
    50  	return f(params)
    51  }