Documentation ¶
Index ¶
- Constants
- Variables
- func GetEmailList() []string
- func GetIP() string
- func Init(cfg *Config)
- func Reverse(s string) string
- func SendEmail(info *EmailInfo)
- func WaitQuit(beforeQuitFunc func())
- type Config
- type Email
- type EmailConfig
- type EmailInfo
- type EmailToConfig
- type History
- type LedConfig
- type Mode
- type OneNetConfig
- type Point
- type RelayConfig
- type RpiModel
- type StepMotorConfig
- type WsnConfig
Constants ¶
View Source
const ( // DevMode ... DevMode = "dev" // PrdMode ... PrdMode = "prd" )
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 ¶
View Source
var ErrEmpty = errors.New("empty")
ErrEmpty ...
Functions ¶
Types ¶
type Config ¶
type Config struct { Led *LedConfig `json:"led"` Relay *RelayConfig `json:"relay"` StepMotor *StepMotorConfig `json:"stepmotor"` Wsn *WsnConfig `json:"wsn"` OneNet *OneNetConfig `json:"onenet"` Email *EmailConfig `json:"email"` EmailTo *EmailToConfig `json:"emailto"` }
Config ...
type Email ¶
type Email struct { SMTP string SMTPPort int POP string POPPort int Address string Password string }
Email ...
type EmailConfig ¶
type EmailConfig struct { SMTP string `json:"smtp"` SMTPPort int `json:"smtp_port"` POP string `json:"pop"` POPPort int `json:"pop_port"` Address string `json:"addr"` Password string `json:"password"` }
EmailConfig ...
type OneNetConfig ¶
OneNetConfig ...
type RpiModel ¶
type RpiModel string
RpiModel ...
const ( // RpiUnknown ... RpiUnknown RpiModel = "Raspberry Pi X Model" // Rpi0 ... Rpi0 RpiModel = "Raspberry Pi Zero Model" // RpiA ... RpiA RpiModel = "Raspberry Pi A Model" // RpiB ... RpiB RpiModel = "Raspberry Pi B Model" // Rpi2 ... Rpi2 RpiModel = "Raspberry Pi 2 Model" // Rpi3 ... Rpi3 RpiModel = "Raspberry Pi 3 Model" // Rpi4 ... Rpi4 RpiModel = "Raspberry Pi 4 Model" )
Click to show internal directories.
Click to hide internal directories.