metadata

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Firmware                   = "fw-name"
	Hardware                   = "hw-model"
	Manufacturer               = "hw-manufacturer"
	SerialNumber               = "hw-serial-number"
	LastRebootReason           = "hw-last-reboot-reason"
	Protocol                   = "webpa-protocol"
	BootTime                   = "boot-time"
	BootTimeRetryDelay         = "boot-time-retry-wait"
	InterfaceUsed       string = "webpa-interface-used"
	InterfacesAvailable        = "interfaces-available"
)
View Source
const (
	HeaderName = "X-Webpa-Convey"
)

Variables

View Source
var (
	ErrInvalidInput = errors.New("invalid input")
)

Functions

This section is empty.

Types

type MetadataProvider

type MetadataProvider struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*MetadataProvider, error)

func (*MetadataProvider) Decorate

func (c *MetadataProvider) Decorate(headers http.Header) error

func (*MetadataProvider) DecorateMsg

func (c *MetadataProvider) DecorateMsg(msg *wrp.Message) error

func (*MetadataProvider) GetMetadata

func (c *MetadataProvider) GetMetadata() map[string]interface{}

type Option

type Option interface {
	// contains filtered or unexported methods
}

func AppendToMsg added in v0.8.2

func AppendToMsg(appendToMsg bool) Option

the identity metadata is usually transmitted to the cloud via the convey header on connect. optionally append the identity metadata to every wrp message. (temporary workaround for home cloud issues)

func BootRetryWaitOpt

func BootRetryWaitOpt(bootTimeRetryDelay time.Duration) Option

func BootTimeOpt

func BootTimeOpt(bootTime string) Option

func FieldsOpt

func FieldsOpt(fields []string) Option

func FirmwareOpt

func FirmwareOpt(firmware string) Option

func HardwareModelOpt

func HardwareModelOpt(hardwareModel string) Option

func InterfaceUsedOpt

func InterfaceUsedOpt(interfaceUsed string) Option

if we want websocket to populate this value, pass in InterfaceUsedProvider instead

func LastRebootReasonOpt

func LastRebootReasonOpt(lastRebootReason string) Option

func ManufacturerOpt

func ManufacturerOpt(manufacturer string) Option

func NetworkServiceOpt

func NetworkServiceOpt(networkService net.NetworkServicer) Option

func SerialNumberOpt

func SerialNumberOpt(serialNumber string) Option

func XmidtProtocolOpt

func XmidtProtocolOpt(protocol string) Option

Jump to

Keyboard shortcuts

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