client

package
v0.0.0-...-f99fb5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, logger *logrus.Entry, project string) (*Client, error)

NewClient instantiates a new GCP Client instance and sets an active project. If the project string is empty, the GCP Client will check how many projects are available, if there is only one, it will be picked. Otherwise, an error will be returned that the client does not know which project should be used.

func (*Client) AddRouterBGPPeer

func (c *Client) AddRouterBGPPeer(
	ctx context.Context, region, routerID string, bgpPeer CloudRouterBGPPeer,
) (*CloudRouter, error)

func (*Client) AddRouterInterface

func (c *Client) AddRouterInterface(
	ctx context.Context, region, routerID string, iface CloudRouterInterface,
) (*CloudRouter, error)

func (*Client) Close

func (c *Client) Close() error

Close closes all internal clients used by this client.

Call it as soon as your main Client is not in use anymore.

func (*Client) CreateExternalVPNGateway

func (c *Client) CreateExternalVPNGateway(
	ctx context.Context, gw *ExternalVPNGateway,
) (*ExternalVPNGateway, error)

func (*Client) CreateVPNTunnel

func (c *Client) CreateVPNTunnel(
	ctx context.Context, tunnel *VPNTunnel, region string,
) (*VPNTunnel, error)

func (*Client) DeleteExternalVPNGateway

func (c *Client) DeleteExternalVPNGateway(
	ctx context.Context, name string,
) error

func (*Client) DeleteRouterBGPPeer

func (c *Client) DeleteRouterBGPPeer(
	ctx context.Context, region, routerID, name string,
) error

func (*Client) DeleteRouterInterface

func (c *Client) DeleteRouterInterface(
	ctx context.Context, region, routerID, name string,
) error

func (*Client) DeleteVPNTunnel

func (c *Client) DeleteVPNTunnel(
	ctx context.Context, region, name string,
) error

func (*Client) FindVPNGatewaysForNetwork

func (c *Client) FindVPNGatewaysForNetwork(ctx context.Context, region, networkID string) ([]*VPNGateway, error)

func (*Client) GetExternalVPNGateway

func (c *Client) GetExternalVPNGateway(ctx context.Context, externalVPNGatewayID string) (*ExternalVPNGateway, error)

func (*Client) GetName

func (c *Client) GetName() string

func (*Client) GetNetwork

func (c *Client) GetNetwork(ctx context.Context, networkID string) (*Network, error)

func (*Client) GetRouter

func (c *Client) GetRouter(ctx context.Context, region, routerID string) (*CloudRouter, error)

func (*Client) GetSubnetwork

func (c *Client) GetSubnetwork(ctx context.Context, region, subnetworkID string) (*Subnetwork, error)

func (*Client) GetVPNGateway

func (c *Client) GetVPNGateway(ctx context.Context, region, gatewayID string) (*VPNGateway, error)

func (*Client) GetVPNTunnel

func (c *Client) GetVPNTunnel(ctx context.Context, region, vpnTunnelID string) (*VPNTunnel, error)

func (*Client) ListExternalVPNGateway

func (c *Client) ListExternalVPNGateway(ctx context.Context) ([]*ExternalVPNGateway, error)

func (*Client) ListNetworks

func (c *Client) ListNetworks(ctx context.Context) ([]*Network, error)

func (*Client) ListRouters

func (c *Client) ListRouters(ctx context.Context, region string) ([]*CloudRouter, error)

func (*Client) ListVPNGateways

func (c *Client) ListVPNGateways(ctx context.Context, region string) ([]*VPNGateway, error)

func (*Client) ListVPNTunnels

func (c *Client) ListVPNTunnels(ctx context.Context, region string) ([]*VPNTunnel, error)

type CloudRouter

type CloudRouter struct {
	Name       string
	Network    string
	BGP        *CloudRouterBGP
	BGPPeers   []CloudRouterBGPPeer
	URL        string
	Interfaces []CloudRouterInterface
}

func (CloudRouter) String

func (c CloudRouter) String() string

type CloudRouterBGP

type CloudRouterBGP struct {
	ASN              string
	AdvertiseMode    string
	AdvertisedGroups []string
}

func (CloudRouterBGP) String

func (c CloudRouterBGP) String() string

type CloudRouterBGPPeer

type CloudRouterBGPPeer struct {
	Name          string
	ASN           string
	Interface     string
	PeerIPAddress string
}

func (CloudRouterBGPPeer) String

func (c CloudRouterBGPPeer) String() string

type CloudRouterInterface

type CloudRouterInterface struct {
	Name      string
	VPNTunnel string
	IpRange   string
}

func (CloudRouterInterface) String

func (c CloudRouterInterface) String() string

type ExternalVPNGateway

type ExternalVPNGateway struct {
	Name       string
	URL        string
	Interfaces []ExternalVPNGatewayInterface
}

func (ExternalVPNGateway) String

func (e ExternalVPNGateway) String() string

type ExternalVPNGatewayInterface

type ExternalVPNGatewayInterface struct {
	IP string
}

func (ExternalVPNGatewayInterface) String

type Network

type Network struct {
	Name    string
	Subnets []string
}

func (Network) String

func (n Network) String() string

type Subnetwork

type Subnetwork struct {
	Name string
	CIDR string
}

func (Subnetwork) String

func (s Subnetwork) String() string

type VPNGateway

type VPNGateway struct {
	Name        string
	URL         string
	Network     string
	IPAddresses []string
}

func (VPNGateway) String

func (v VPNGateway) String() string

type VPNTunnel

type VPNTunnel struct {
	Name                     string
	URL                      string
	ExternalVPNGateway       string
	ExternalGatewayInterface int
	IKEVersion               int32
	SharedSecret             string
	CloudRouter              string
	VPNGateway               string
	Interface                int
}

func (VPNTunnel) String

func (v VPNTunnel) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL