iot

package
v0.0.0-...-d12e797 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WsnToken is the token of wsn iot cloud
	WsnToken = "your_wsn_token"
	// WsnNumericalAPI is the api of wsn iot cloud for pushing numerical datapoints
	WsnNumericalAPI = "http://www.wsncloud.com/api/data/v1/numerical/insert"
	// WsnGenericAPI is the api of wsn iot cloud for pushing generic datapoints
	WsnGenericAPI = "http://www.wsncloud.com/api/data/v1/generic/insert"
)
View Source
const (
	// OneNetToken is the token of OneNet iot cloud
	OneNetToken = "your_onenet_token"
	// OneNetAPI is the api of OneNet iot cloud for pushing datapoints
	OneNetAPI = "http://api.heclouds.com/devices/540381180/datapoints"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloud

type Cloud interface {
	Push(v *Value) error
}

Cloud is the interface of IOT clound

func NewCloud

func NewCloud(config interface{}) Cloud

NewCloud ...

type Datapoint

type Datapoint struct {
	Value interface{} `json:"value"`
}

Datapoint ...

type Datastream

type Datastream struct {
	ID         string       `json:"id"`
	Datapoints []*Datapoint `json:"datapoints"`
}

Datastream ...

type OneNetCloud

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

OneNetCloud is the implement of Cloud

func NewOneNetCloud

func NewOneNetCloud(cfg *OneNetConfig) *OneNetCloud

NewOneNetCloud ...

func (*OneNetCloud) Push

func (o *OneNetCloud) Push(v *Value) error

Push ...

type OneNetConfig

type OneNetConfig struct {
	Token string `json:"token"`
	API   string `json:"api"`
}

OneNetConfig ...

type OneNetData

type OneNetData struct {
	Datastreams []*Datastream `json:"datastreams"`
}

OneNetData ...

type Value

type Value struct {
	Device string
	Value  interface{}
}

Value ...

type WsnCloud

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

WsnCloud is the implement of Cloud

func NewWsnClound

func NewWsnClound(cfg *WsnConfig) *WsnCloud

NewWsnClound ...

func (*WsnCloud) Push

func (w *WsnCloud) Push(v *Value) error

Push ...

type WsnConfig

type WsnConfig struct {
	Token string `json:"token"`
	API   string `json:"api"`
}

WsnConfig ...

Jump to

Keyboard shortcuts

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