packet

package
v1.1.1-0...-77a217a Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAnnotationNodeASN  = "packet.com/node.asn"
	DefaultAnnotationPeerASNs = "packet.com/peer.asns"
	DefaultAnnotationPeerIPs  = "packet.com/peer.ips"
	DefaultLocalASN           = 65000
	DefaultPeerASN            = 65530
	DefaultAPIServerPort      = 6443
)
View Source
const (

	// ConsumerToken token for packet consumer
	ConsumerToken string = "packet-ccm"
)

Variables

View Source
var (
	// VERSION is reported in the API User-Agent
	VERSION = "devel"
)

Functions

func GetAndParseMetadata

func GetAndParseMetadata(u string) (*metadata.CurrentDevice, error)

GetAndParseMetadata retrieve metadata from a specific URL or Packet's standard

func InitializeProvider

func InitializeProvider(packetConfig Config) error

Types

type Config

type Config struct {
	AuthToken             string  `json:"apiKey"`
	ProjectID             string  `json:"projectId"`
	BaseURL               *string `json:"base-url,omitempty"`
	LoadBalancerConfigMap string  `json:"loadbalancer-configmap"`
	Facility              string  `json:"facility,omitempty"`
	PeerASN               int     `json:"peerASN,omitempty"`
	LocalASN              int     `json:"localASN,omitempty"`
	AnnotationLocalASN    string  `json:"annotationLocalASN,omitEmpty"`
	AnnotationPeerASNs    string  `json:"annotationPeerASNs,omitEmpty"`
	AnnotationPeerIPs     string  `json:"annotationPeerIPs,omitEmpty"`
	EIPTag                string  `json:"eipTag,omitEmpty"`
	APIServerPort         int     `json:"apiServerPort,omitEmpty"`
}

Config configuration for a provider, includes authentication token, project ID ID, and optional override URL to talk to a different packet API endpoint

func (Config) Strings

func (c Config) Strings() []string

String converts the Config structure to a string, while masking hidden fields. Is not 100% a String() conversion, as it adds some intelligence to the output, and masks sensitive data

type UpdateMode

type UpdateMode int
const (
	ModeAdd UpdateMode = iota
	ModeRemove
	ModeSync
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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