Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReU0 *regexp.Regexp ReWild *regexp.Regexp )
Functions ¶
func IsNil ¶
func IsNil(str NilOrString) bool
func String ¶
func String(str NilOrString) string
func ValidMqttPublishTopic ¶
ValidMqttPublishTopic validates the Topic is validate or not This is used with validator packages.
Types ¶
type Config ¶
type Config struct { GatewayName string BrokerNames []string Sections []ConfigSection }
func LoadConfig ¶
LoadConfig loads toml format file from confPath arg and returns []ConfigSection. ConfigSection has a Type, Name and arg. example: [[broker."sango"]] [[broker."sango/1"]] [[broker."sango/2"]]
ret = [
ConfigSection{Type: "broker", Name: "sango"}, ConfigSection{Type: "broker", Name: "sango", Arg: "1"}, ConfigSection{Type: "broker", Name: "sango", Arg: "2"},
]
func LoadConfigByte ¶
LoadConfigByte returns []ConfigSection from []byte. This is invoked from LoadConfig.
type ConfigSection ¶
func SearchDeviceType ¶
func SearchDeviceType(sections *[]ConfigSection, arg string) *ConfigSection
SearchDeviceType find the device section matched type name string
func SearchSection ¶
func SearchSection(sections *[]ConfigSection, t, arg string) *ConfigSection
SearchSection finds the section matched condition args.
type ConfigToml ¶
type ConfigToml struct { Gateway SectionMap `toml:"gateway"` Brokers SectionMap `toml:"broker"` Devices SectionMap `toml:"device"` Status SectionMap `toml:"status"` }
type SectionMap ¶
type SectionMap map[string]interface{}
Click to show internal directories.
Click to hide internal directories.