packet

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddress = "https://metadata.packet.net/"
)

Variables

This section is empty.

Functions

func NewDatasource

func NewDatasource(root string) *metadataService

Types

type Metadata

type Metadata struct {
	Hostname    string      `json:"hostname"`
	SSHKeys     []string    `json:"ssh_keys"`
	NetworkData NetworkData `json:"network"`
}

Metadata that will be pulled from the https://metadata.packet.net/metadata only. We have the opportunity to add more later.

type Netblock

type Netblock struct {
	Address       net.IP `json:"address"`
	Cidr          int    `json:"cidr"`
	Netmask       net.IP `json:"netmask"`
	Gateway       net.IP `json:"gateway"`
	AddressFamily int    `json:"address_family"`
	Public        bool   `json:"public"`
}

type NetworkData

type NetworkData struct {
	Interfaces []Nic      `json:"interfaces"`
	Netblocks  []Netblock `json:"addresses"`
	DNS        []net.IP   `json:"dns"`
}

type Nic

type Nic struct {
	Name string `json:"name"`
	Mac  string `json:"mac"`
}

Jump to

Keyboard shortcuts

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