Help us shape the future of Go! Take the 2026 Go Developer Survey

packet

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 5 Imported by: 49

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