processor

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DEVICETYPE_ANDROID string = "ANDROID" //android"),
View Source
const DEVICETYPE_GATEWAY string = "GATEWAY" //网关"),
View Source
const DEVICETYPE_IOS string = "IOS" //ios"),
View Source
const DEVICETYPE_MESH string = "MESH" //MESH网关"),
View Source
const DEVICETYPE_MOBILE string = "MOBILE" //手机"),
View Source
const DEVICETYPE_OTHER string = "OTHER" //OTHER"),
View Source
const DEVICETYPE_SERVER string = "SERVER" //服务器"),
View Source
const DeviceTypeDefault = "Default"

Variables

Functions

func InitProcessor

func InitProcessor(r IDpReportProcessor) error

InitProcessor 实现类自己主动注册进来

func MatchDeviceType

func MatchDeviceType(devId string) (string, error)

func MatchString

func MatchString(pattern string, s string) bool

Types

type DefaultDpReportProcessor

type DefaultDpReportProcessor struct {
}

func (*DefaultDpReportProcessor) DeviceType

func (p *DefaultDpReportProcessor) DeviceType() string

func (*DefaultDpReportProcessor) Process

func (p *DefaultDpReportProcessor) Process(topicDevId string, Data map[string]string) (bool, error)

type IDpReportProcessor

type IDpReportProcessor interface {
	DeviceType() string
	Process(topicDevId string, Data map[string]string) (bool, error)
}

func GetDpReportProcessor

func GetDpReportProcessor(protocolVersion string) IDpReportProcessor

type MeshDpReportProcessor

type MeshDpReportProcessor struct {
}

func (*MeshDpReportProcessor) DeviceType

func (p *MeshDpReportProcessor) DeviceType() string

func (*MeshDpReportProcessor) Process

func (p *MeshDpReportProcessor) Process(topicDevId string, Data map[string]string) (bool, error)

Jump to

Keyboard shortcuts

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