gcp

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package gcp contains the GCP implementation of the [platform.Platform].

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCP

type GCP struct{}

GCP is the concrete type that implements the platform.Platform interface.

func (*GCP) Configuration

func (g *GCP) Configuration(ctx context.Context, r state.State) ([]byte, error)

Configuration implements the platform.Platform interface.

func (*GCP) KernelArgs

func (g *GCP) KernelArgs(string) procfs.Parameters

KernelArgs implements the runtime.Platform interface.

func (*GCP) Mode

func (g *GCP) Mode() runtime.Mode

Mode implements the platform.Platform interface.

func (*GCP) Name

func (g *GCP) Name() string

Name implements the platform.Platform interface.

func (*GCP) NetworkConfiguration

func (g *GCP) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error

NetworkConfiguration implements the runtime.Platform interface.

func (*GCP) ParseMetadata

func (g *GCP) ParseMetadata(metadata *MetadataConfig, interfaces []NetworkInterfaceConfig) (*runtime.PlatformNetworkConfig, error)

ParseMetadata converts GCP platform metadata into platform network config.

type MetadataConfig

type MetadataConfig struct {
	ProjectID    string `json:"project-id"`
	Name         string `json:"name,omitempty"`
	Hostname     string `json:"hostname,omitempty"`
	Zone         string `json:"zone,omitempty"`
	InstanceType string `json:"machine-type"`
	InstanceID   string `json:"id"`
	Preempted    string `json:"preempted"`
}

MetadataConfig holds meta info.

type NetworkInterfaceConfig added in v1.4.0

type NetworkInterfaceConfig struct {
	AccessConfigs []struct {
		ExternalIP string `json:"externalIp,omitempty"`
		Type       string `json:"type,omitempty"`
	} `json:"accessConfigs,omitempty"`
	GatewayIPv4 string   `json:"gateway,omitempty"`
	GatewayIPv6 string   `json:"gatewayIpv6,omitempty"`
	IPv4        string   `json:"ip,omitempty"`
	IPv6        []string `json:"ipv6,omitempty"`
	MTU         int      `json:"mtu,omitempty"`
}

NetworkInterfaceConfig holds network meta info.

Jump to

Keyboard shortcuts

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