Documentation ¶
Index ¶
Constants ¶
View Source
const ( Path = "./config.toml" Hearbeat = "channels.heartbeat.>" Commands = "commands" )
Variables ¶
View Source
var ( // ErrMalformedEntity indicates malformed entity specification. ErrMalformedEntity = errors.New("malformed entity specification") // ErrInvalidQueryParams indicates malformed URL. ErrInvalidQueryParams = errors.New("invalid query params") )
Functions ¶
Types ¶
type ChanConfig ¶
type Config ¶
type Config struct { Server ServerConfig `toml:"server" json:"server"` Terminal TerminalConfig `toml:"terminal" json:"terminal"` Heartbeat HeartbeatConfig `toml:"heartbeat" json:"heartbeat"` Channels ChanConfig `toml:"channels" json:"channels"` Edgex EdgexConfig `toml:"edgex" json:"edgex"` Log LogConfig `toml:"log" json:"log"` MQTT MQTTConfig `toml:"mqtt" json:"mqtt"` File string }
func NewConfig ¶
func NewConfig(sc ServerConfig, cc ChanConfig, ec EdgexConfig, lc LogConfig, mc MQTTConfig, hc HeartbeatConfig, tc TerminalConfig, file string) Config
type EdgexConfig ¶
type EdgexConfig struct {
URL string `toml:"url"`
}
type Heartbeat ¶
type Heartbeat interface { Update() Info() Info }
Heartbeat specifies api for updating status and keeping track on services that are sending heartbeat to NATS.
type HeartbeatConfig ¶
func (*HeartbeatConfig) UnmarshalJSON ¶
func (d *HeartbeatConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON parses the duration from JSON.
type MQTTConfig ¶
type MQTTConfig struct { URL string `json:"url" toml:"url"` Username string `json:"username" toml:"username" mapstructure:"username"` Password string `json:"password" toml:"password" mapstructure:"password"` MTLS bool `json:"mtls" toml:"mtls" mapstructure:"mtls"` SkipTLSVer bool `json:"skip_tls_ver" toml:"skip_tls_ver" mapstructure:"skip_tls_ver"` Retain bool `json:"retain" toml:"retain" mapstructure:"retain"` QoS byte `json:"qos" toml:"qos" mapstructure:"qos"` CAPath string `json:"ca_path" toml:"ca_path" mapstructure:"ca_path"` CertPath string `json:"cert_path" toml:"cert_path" mapstructure:"cert_path"` PrivKeyPath string `json:"priv_key_path" toml:"priv_key_path" mapstructure:"priv_key_path"` CA []byte `json:"-" toml:"-"` Cert tls.Certificate `json:"-" toml:"-"` ClientCert string `json:"client_cert" toml:"client_cert"` ClientKey string `json:"client_key" toml:"client_key"` CaCert string `json:"ca_cert" toml:"ca_cert"` }
type ServerConfig ¶
type Service ¶
type Service interface { // Execute command. Execute(string, string) (string, error) // Control command. Control(string, string) error // Update configuration file. AddConfig(Config) error // Config returns Config struct created from config file. Config() Config // Saves config file. ServiceConfig(ctx context.Context, uuid, cmdStr string) error // Services returns service list. Services() []Info // Terminal used for terminal control of gateway. Terminal(string, string) error // Publish message. Publish(string, string) error }
Service specifies API for publishing messages and subscribing to topics.
type TerminalConfig ¶
type TerminalConfig struct {
SessionTimeout time.Duration `toml:"session_timeout" json:"session_timeout"`
}
func (*TerminalConfig) UnmarshalJSON ¶
func (d *TerminalConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON parses the duration from JSON.
Click to show internal directories.
Click to hide internal directories.