metadata

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 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 DefaultInterface = "erouter0"
View Source
const (
	HeaderName = "X-Webpa-Convey"
)

Variables

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

Functions

This section is empty.

Types

type InterfaceUsedProvider

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

func NewInterfaceUsedProvider

func NewInterfaceUsedProvider() (*InterfaceUsedProvider, error)

func (*InterfaceUsedProvider) GetInterfaceUsed

func (i *InterfaceUsedProvider) GetInterfaceUsed() string

func (*InterfaceUsedProvider) SetInterfaceUsed

func (i *InterfaceUsedProvider) SetInterfaceUsed(interfaceUsed string)

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 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 *InterfaceUsedProvider) Option

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