wrpmetadata

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

wrpmetadata

A library to help us use and document assorted wrp metadata fields.

Build Status codecov Go Report Card Apache V2 License GitHub Release GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionInterface

type ConnectionInterface int

ConnectionInterface represents the type of network interface a CPE (Customer Premises Equipment) uses to connect to the Xmidt cloud. The CPE reports a raw interface name (e.g. "erouter0") that is then mapped to one of these canonical types.

const (
	// Unknown indicates the interface name was empty or unrecognized
	// as a known CPE interface.
	Unknown ConnectionInterface = iota

	// Cellular represents a generic cellular/mobile data connection.
	Cellular

	// CellularLte is a cellular connection known to be LTE.
	CellularLte

	// Docsis represents a Data Over Cable Service Interface
	// Specification (DOCSIS) connection.
	Docsis

	// Dsl represents a Digital Subscriber Line (DSL)connection.
	Dsl

	// Lan represents a generic LAN connection.
	Lan

	// LanEthernet represents an Ethernet-based LAN connection.
	LanEthernet

	// LanWifi represents a WiFi-based LAN connection.
	LanWifi

	// Other represents a recognized but unmapped interface name.
	Other

	// Wifi represents a direct WiFi connection.
	Wifi
)

func ConvertCpeInterface

func ConvertCpeInterface(iName string, model string) ConnectionInterface

ConvertCpeInterface maps a raw CPE network interface name and hardware model to a canonical ConnectionInterface. The interface name is the value the CPE sets in the "webpa-interface-used" metadata field (part of X-Xmidt-Metadata). The model parameter is the "hw-model" metadata value and is used to further refine the mapping (e.g. distinguishing CellularLte from Cellular).

Empty or "unknown" interface names return Unknown. Unrecognized non-empty names return Other.

func (ConnectionInterface) String

func (ci ConnectionInterface) String() string

Jump to

Keyboard shortcuts

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