Documentation
¶
Index ¶
- Constants
- type DUTComponent
- func (c *DUTComponent) CanHandle(deviceType components.DeviceType, payload *components.RawPayload) bool
- func (c *DUTComponent) GetInfo() components.ComponentInfo
- func (c *DUTComponent) GetSupportedDevices() []components.DeviceType
- func (c *DUTComponent) GetSupportedEntityTypes(deviceType components.DeviceType) []string
- func (c *DUTComponent) GetSupportedPorts(deviceType components.DeviceType) []int
- func (c *DUTComponent) Parse(ctx context.Context, deviceType components.DeviceType, ...) (*components.ParsedData, error)
- func (c *DUTComponent) ParseToEntities(ctx context.Context, orgSlug, model string, deviceType components.DeviceType, ...) (*components.ParseResult, error)
- func (c *DUTComponent) SupportsGPS(deviceType components.DeviceType) bool
- func (c *DUTComponent) Validate(deviceType components.DeviceType, data *components.ParsedData) error
- type DeviceParser
- type WLBV1Parser
- func (p *WLBV1Parser) GetSupportedEntityTypes() []string
- func (p *WLBV1Parser) GetSupportedPorts() []int
- func (p *WLBV1Parser) ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
- func (p *WLBV1Parser) ParseToEntities(orgSlug, model string, payload *components.RawPayload, ...) ([]components.Entity, error)
- func (p *WLBV1Parser) SupportsGPS() bool
Constants ¶
const (
DeviceTypeWLBV1 = "WLBV1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DUTComponent ¶
type DUTComponent struct {
// contains filtered or unexported fields
}
This follows a manufacturer-based component pattern
func NewDUTComponent ¶
func NewDUTComponent() *DUTComponent
NewDUTComponent creates a new DUT component
func (*DUTComponent) CanHandle ¶
func (c *DUTComponent) CanHandle(deviceType components.DeviceType, payload *components.RawPayload) bool
CanHandle checks if this component can handle the given device type and payload
func (*DUTComponent) GetInfo ¶
func (c *DUTComponent) GetInfo() components.ComponentInfo
GetInfo returns component metadata
func (*DUTComponent) GetSupportedDevices ¶
func (c *DUTComponent) GetSupportedDevices() []components.DeviceType
GetSupportedDevices returns the device types this component supports
func (*DUTComponent) GetSupportedEntityTypes ¶
func (c *DUTComponent) GetSupportedEntityTypes(deviceType components.DeviceType) []string
GetSupportedEntityTypes returns the entity types this device supports
func (*DUTComponent) GetSupportedPorts ¶
func (c *DUTComponent) GetSupportedPorts(deviceType components.DeviceType) []int
GetSupportedPorts returns the fPorts this device type uses
func (*DUTComponent) Parse ¶
func (c *DUTComponent) Parse(ctx context.Context, deviceType components.DeviceType, payload *components.RawPayload) (*components.ParsedData, error)
Parse converts raw payload into structured ParsedData (DEPRECATED: Use ParseToEntities)
func (*DUTComponent) ParseToEntities ¶
func (c *DUTComponent) ParseToEntities(ctx context.Context, orgSlug, model string, deviceType components.DeviceType, payload *components.RawPayload, deviceLocation *components.Location) (*components.ParseResult, error)
ParseToEntities converts raw payload into multiple entities
func (*DUTComponent) SupportsGPS ¶
func (c *DUTComponent) SupportsGPS(deviceType components.DeviceType) bool
SupportsGPS returns true if the device has built-in GPS
func (*DUTComponent) Validate ¶
func (c *DUTComponent) Validate(deviceType components.DeviceType, data *components.ParsedData) error
Validate performs device-specific validation on the parsed data
type DeviceParser ¶
type DeviceParser interface {
ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)
SupportsGPS() bool
GetSupportedPorts() []int
GetSupportedEntityTypes() []string
}
DeviceParser handles device-specific parsing logic
type WLBV1Parser ¶
type WLBV1Parser struct{}
WLBV1Parser handles parsing of WLB V1 device payloads
func (*WLBV1Parser) GetSupportedEntityTypes ¶
func (p *WLBV1Parser) GetSupportedEntityTypes() []string
GetSupportedEntityTypes returns entity types supported by WLB V1
func (*WLBV1Parser) GetSupportedPorts ¶
func (p *WLBV1Parser) GetSupportedPorts() []int
GetSupportedPorts returns the fPorts typically used by WLB V1
func (*WLBV1Parser) ParsePayload ¶
func (p *WLBV1Parser) ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
ParsePayload parses WLB V1 device payload and extracts GPS coordinates
func (*WLBV1Parser) ParseToEntities ¶
func (p *WLBV1Parser) ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)
ParseToEntities creates entities for WLB V1 device
func (*WLBV1Parser) SupportsGPS ¶
func (p *WLBV1Parser) SupportsGPS() bool
SupportsGPS returns true since WLB V1 can have GPS capability depending on configuration