inidef

package
v0.0.0-...-064367d Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(str NilOrString) bool

func String

func String(str NilOrString) string

func ValidMqttPublishTopic

func ValidMqttPublishTopic(v interface{}, param string) error

ValidMqttPublishTopic validates the Topic is validate or not This is used with validator packages.

Types

type AnyError

type AnyError interface{}

type Config

type Config struct {
	GatewayName string
	BrokerNames []string

	Sections []ConfigSection
}

func LoadConfig

func LoadConfig(confPath string) (Config, error)

Loadini loads ini 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

func LoadConfigByte(conf []byte) (Config, error)

LoadConfigByte returnes []ConfigSection from []byte. This is invoked from LoadConfig.

type ConfigSection

type ConfigSection struct {
	Title string
	Type  string
	Name  string
	Arg   string

	Values map[string]string
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type InputPortType

type InputPortType int

InputPortType defines port type used by gateway

const (
	INPUT_PORT_SERIAL InputPortType = 0
	INPUT_PORT_DUMMY  InputPortType = 1
)

type NilOrString

type NilOrString interface{}

NilOrString defines the value is nil or empty

Jump to

Keyboard shortcuts

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