2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
package gcp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
compute "cloud.google.com/go/compute/apiv1"
|
2022-12-08 05:26:51 -05:00
|
|
|
"cloud.google.com/go/compute/apiv1/computepb"
|
2022-03-22 11:03:15 -04:00
|
|
|
"github.com/googleapis/gax-go/v2"
|
|
|
|
)
|
|
|
|
|
2022-11-09 08:43:48 -05:00
|
|
|
type forwardingRuleIterator interface {
|
|
|
|
Next() (*computepb.ForwardingRule, error)
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-11-09 08:43:48 -05:00
|
|
|
type instanceIterator interface {
|
|
|
|
Next() (*computepb.Instance, error)
|
2022-05-24 04:04:42 -04:00
|
|
|
}
|
|
|
|
|
2022-12-28 07:30:39 -05:00
|
|
|
type globalForwardingRulesClient struct {
|
2022-08-31 21:40:29 -04:00
|
|
|
*compute.GlobalForwardingRulesClient
|
2022-06-09 16:26:36 -04:00
|
|
|
}
|
|
|
|
|
2022-12-28 07:30:39 -05:00
|
|
|
func (c *globalForwardingRulesClient) Close() error {
|
2022-08-31 21:40:29 -04:00
|
|
|
return c.GlobalForwardingRulesClient.Close()
|
2022-06-09 16:26:36 -04:00
|
|
|
}
|
|
|
|
|
2022-12-28 07:30:39 -05:00
|
|
|
func (c *globalForwardingRulesClient) List(ctx context.Context, req *computepb.ListGlobalForwardingRulesRequest,
|
2023-03-20 06:03:36 -04:00
|
|
|
_ ...gax.CallOption,
|
2022-11-09 08:43:48 -05:00
|
|
|
) forwardingRuleIterator {
|
2022-08-31 21:40:29 -04:00
|
|
|
return c.GlobalForwardingRulesClient.List(ctx, req)
|
2022-06-09 16:26:36 -04:00
|
|
|
}
|
|
|
|
|
2022-12-28 07:30:39 -05:00
|
|
|
type regionalForwardingRulesClient struct {
|
|
|
|
*compute.ForwardingRulesClient
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *regionalForwardingRulesClient) Close() error {
|
|
|
|
return c.ForwardingRulesClient.Close()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *regionalForwardingRulesClient) List(ctx context.Context, req *computepb.ListForwardingRulesRequest,
|
2023-03-20 06:03:36 -04:00
|
|
|
_ ...gax.CallOption,
|
2022-12-28 07:30:39 -05:00
|
|
|
) forwardingRuleIterator {
|
|
|
|
return c.ForwardingRulesClient.List(ctx, req)
|
|
|
|
}
|
|
|
|
|
2022-11-09 08:43:48 -05:00
|
|
|
type instanceClient struct {
|
|
|
|
*compute.InstancesClient
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-11-09 08:43:48 -05:00
|
|
|
func (c *instanceClient) Close() error {
|
|
|
|
return c.InstancesClient.Close()
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-11-09 08:43:48 -05:00
|
|
|
func (c *instanceClient) List(ctx context.Context, req *computepb.ListInstancesRequest,
|
2023-03-20 06:03:36 -04:00
|
|
|
_ ...gax.CallOption,
|
2022-11-09 08:43:48 -05:00
|
|
|
) instanceIterator {
|
|
|
|
return c.InstancesClient.List(ctx, req)
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|