Documentation ¶
Overview ¶
Package digitalocean contains the Digital Ocean implementation of the [platform.Platform].
Index ¶
- Constants
- type DigitalOcean
- func (d *DigitalOcean) Configuration(ctx context.Context, r state.State) ([]byte, error)
- func (d *DigitalOcean) KernelArgs(string) procfs.Parameters
- func (d *DigitalOcean) Mode() runtime.Mode
- func (d *DigitalOcean) Name() string
- func (d *DigitalOcean) NetworkConfiguration(ctx context.Context, _ state.State, ch chan<- *runtime.PlatformNetworkConfig) error
- func (d *DigitalOcean) ParseMetadata(metadata *MetadataConfig) (*runtime.PlatformNetworkConfig, error)
- type MetadataConfig
Constants ¶
View Source
const ( // DigitalOceanExternalIPEndpoint displays all external addresses associated with the instance. DigitalOceanExternalIPEndpoint = "http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address" // DigitalOceanMetadataEndpoint is the local endpoint for the platform metadata. DigitalOceanMetadataEndpoint = "http://169.254.169.254/metadata/v1.json" // DigitalOceanUserDataEndpoint is the local endpoint for the config. DigitalOceanUserDataEndpoint = "http://169.254.169.254/metadata/v1/user-data" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DigitalOcean ¶
type DigitalOcean struct{}
DigitalOcean is the concrete type that implements the platform.Platform interface.
func (*DigitalOcean) Configuration ¶
Configuration implements the platform.Platform interface.
func (*DigitalOcean) KernelArgs ¶
func (d *DigitalOcean) KernelArgs(string) procfs.Parameters
KernelArgs implements the runtime.Platform interface.
func (*DigitalOcean) Mode ¶
func (d *DigitalOcean) Mode() runtime.Mode
Mode implements the platform.Platform interface.
func (*DigitalOcean) Name ¶
func (d *DigitalOcean) Name() string
Name implements the platform.Platform interface.
func (*DigitalOcean) NetworkConfiguration ¶
func (d *DigitalOcean) NetworkConfiguration(ctx context.Context, _ state.State, ch chan<- *runtime.PlatformNetworkConfig) error
NetworkConfiguration implements the runtime.Platform interface.
func (*DigitalOcean) ParseMetadata ¶
func (d *DigitalOcean) ParseMetadata(metadata *MetadataConfig) (*runtime.PlatformNetworkConfig, error)
ParseMetadata converts DigitalOcean platform metadata into platform network config.
type MetadataConfig ¶
type MetadataConfig struct { Hostname string `json:"hostname,omitempty"` DropletID int `json:"droplet_id,omitempty"` Region string `json:"region,omitempty"` PublicIPv4 string `json:"public-ipv4,omitempty"` Tags []string `json:"tags,omitempty"` DNS struct { Nameservers []string `json:"nameservers,omitempty"` } `json:"dns,omitempty"` Interfaces map[string][]struct { MACAddress string `json:"mac,omitempty"` Type string `json:"type,omitempty"` IPv4 *struct { IPAddress string `json:"ip_address,omitempty"` Netmask string `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` } `json:"ipv4,omitempty"` IPv6 *struct { IPAddress string `json:"ip_address,omitempty"` CIDR int `json:"cidr,omitempty"` Gateway string `json:"gateway,omitempty"` } `json:"ipv6,omitempty"` AnchorIPv4 *struct { IPAddress string `json:"ip_address,omitempty"` Netmask string `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` } `json:"anchor_ipv4,omitempty"` } `json:"interfaces,omitempty"` }
MetadataConfig represents a metadata Digital Ocean instance.
Click to show internal directories.
Click to hide internal directories.