siteinfo

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ProjectID string
	Version   string
	// contains filtered or unexported fields
}

Client is a Siteinfo client.

func New

func New(projectID, version string, httpClient HTTPProvider) *Client

New returns a new Siteinfo client wrapping the provided *http.Client.

func (Client) Machines added in v0.1.45

func (c Client) Machines() ([]Machine, error)

Machines fetches the sites/machines.json output format and returns its content as a []Machine.

func (Client) Projects added in v0.1.45

func (c Client) Projects() (map[string]string, error)

Projects fetches the sites/projects.json output format and returns its content as a map[<short-node-name>]string.

func (Client) SiteMachines added in v0.1.49

func (c Client) SiteMachines() (map[string][]string, error)

SiteMachines fetches the sites/site-machines.json output format and returns its content as a map[<short-node-name>][]string.

func (Client) Switches

func (c Client) Switches() (map[string]Switch, error)

Switches fetches the sites/switches.json output format and returns its content as a map[site]Switch.

type HTTPProvider

type HTTPProvider interface {
	Get(string) (*http.Response, error)
}

HTTPProvider is a data provider returning HTTP responses. http.Client satisfies this interface.

type Machine added in v0.1.45

type Machine struct {
	Hostname string `json:"hostname"`
	IPv4     string `json:"ipv4"`
	IPv6     string `json:"ipv6"`
	Project  string `json:"project"`
	Type     string `json:"type"`
}

type Switch

type Switch struct {
	AutoNegotiation string `json:"auto_negotation"`
	FlowControl     string `json:"flow_control"`
	IPv4Prefix      string `json:"ipv4_prefix"`
	RSTP            string `json:"rstp"`
	SwitchMake      string `json:"switch_make"`
	SwitchModel     string `json:"switch_model"`
	UplinkPort      string `json:"uplink_port"`
	UplinkSpeed     string `json:"uplink_speed"`
}

Switch is an entity in /v1/sites/switches.json.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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