connector

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// lorawan
	LoraWanType = "lora"
	MqttJson    = "mqtt_json"
	Amqp        = "amq"
)

Variables

This section is empty.

Functions

func RegisterBuilder

func RegisterBuilder(name string, builder Builder)

Types

type Builder

type Builder func(conf Info, props map[string]string, listener UpLinkListener) (c *Connector, err error)

func GetBuilder

func GetBuilder(name string) (b Builder, err error)

type Config

type Config struct {
	ID    string            `json:"id"`
	Name  string            `json:"name"`
	Type  string            `json:"type"`
	Props map[string]string `json:"props"`
}

type Connector

type Connector interface {
	GetID() string
	GetName() string
	GetType() string
	GetState() bool
	// 即时发送
	DownLink(target model.Target, data []byte)
}

type Info

type Info struct {
	Id    string
	Name  string
	Type  string
	State bool
}

func (Info) GetID

func (info Info) GetID() string

func (Info) GetName

func (info Info) GetName() string

func (Info) GetState

func (info Info) GetState() bool

func (Info) GetType

func (info Info) GetType() string

type UpLinkListener

type UpLinkListener func(context *model.LinkMessage)

Directories

Path Synopsis
connectors
mq

Jump to

Keyboard shortcuts

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