sigs.k8s.io/cluster-api-provider-aws@v1.5.5/pkg/cloud/services/gc/options.go (about)

     1  /*
     2  Copyright 2022 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 gc
    18  
    19  import (
    20  	"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
    21  	"github.com/aws/aws-sdk-go/service/elb/elbiface"
    22  	"github.com/aws/aws-sdk-go/service/elbv2/elbv2iface"
    23  	"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/resourcegroupstaggingapiiface"
    24  )
    25  
    26  // ServiceOption is an option for creating the service.
    27  type ServiceOption func(*Service)
    28  
    29  // withELBClient is an option for specifying a AWS ELB Client.
    30  func withELBClient(client elbiface.ELBAPI) ServiceOption {
    31  	return func(s *Service) {
    32  		s.elbClient = client
    33  	}
    34  }
    35  
    36  // withELBv2Client is an option for specifying a AWS ELBv2 Client.
    37  func withELBv2Client(client elbv2iface.ELBV2API) ServiceOption {
    38  	return func(s *Service) {
    39  		s.elbv2Client = client
    40  	}
    41  }
    42  
    43  // withResourceTaggingClient is an option for specifying a AWS Resource Tagging Client.
    44  func withResourceTaggingClient(client resourcegroupstaggingapiiface.ResourceGroupsTaggingAPIAPI) ServiceOption {
    45  	return func(s *Service) {
    46  		s.resourceTaggingClient = client
    47  	}
    48  }
    49  
    50  // withEC2Client is an option for specifying a AWS EC2 Client.
    51  func withEC2Client(client ec2iface.EC2API) ServiceOption {
    52  	return func(s *Service) {
    53  		s.ec2Client = client
    54  	}
    55  }