2023-06-14 18:40:37 +08:00
|
|
|
// Copyright (c) Mainflux
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2019-09-26 01:02:29 +08:00
|
|
|
package bench
|
|
|
|
|
2023-06-14 18:40:37 +08:00
|
|
|
// Keep struct names exported, otherwise Viper unmarshalling won't work.
|
2019-09-26 01:02:29 +08:00
|
|
|
type mqttBrokerConfig struct {
|
|
|
|
URL string `toml:"url" mapstructure:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mqttMessageConfig struct {
|
|
|
|
Size int `toml:"size" mapstructure:"size"`
|
|
|
|
Payload string `toml:"payload" mapstructure:"payload"`
|
|
|
|
Format string `toml:"format" mapstructure:"format"`
|
|
|
|
QoS int `toml:"qos" mapstructure:"qos"`
|
|
|
|
Retain bool `toml:"retain" mapstructure:"retain"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mqttTLSConfig struct {
|
|
|
|
MTLS bool `toml:"mtls" mapstructure:"mtls"`
|
|
|
|
SkipTLSVer bool `toml:"skiptlsver" mapstructure:"skiptlsver"`
|
|
|
|
CA string `toml:"ca" mapstructure:"ca"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mqttConfig struct {
|
|
|
|
Broker mqttBrokerConfig `toml:"broker" mapstructure:"broker"`
|
|
|
|
Message mqttMessageConfig `toml:"message" mapstructure:"message"`
|
|
|
|
Timeout int `toml:"timeout" mapstructure:"timeout"`
|
|
|
|
TLS mqttTLSConfig `toml:"tls" mapstructure:"tls"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type testConfig struct {
|
|
|
|
Count int `toml:"count" mapstructure:"count"`
|
|
|
|
Pubs int `toml:"pubs" mapstructure:"pubs"`
|
|
|
|
Subs int `toml:"subs" mapstructure:"subs"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type logConfig struct {
|
|
|
|
Quiet bool `toml:"quiet" mapstructure:"quiet"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mainfluxFile struct {
|
|
|
|
ConnFile string `toml:"connections_file" mapstructure:"connections_file"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mfThing struct {
|
|
|
|
ThingID string `toml:"thing_id" mapstructure:"thing_id"`
|
|
|
|
ThingKey string `toml:"thing_key" mapstructure:"thing_key"`
|
|
|
|
MTLSCert string `toml:"mtls_cert" mapstructure:"mtls_cert"`
|
|
|
|
MTLSKey string `toml:"mtls_key" mapstructure:"mtls_key"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mfChannel struct {
|
|
|
|
ChannelID string `toml:"channel_id" mapstructure:"channel_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type mainflux struct {
|
|
|
|
Things []mfThing `toml:"things" mapstructure:"things"`
|
|
|
|
Channels []mfChannel `toml:"channels" mapstructure:"channels"`
|
|
|
|
}
|
|
|
|
|
2023-06-14 18:40:37 +08:00
|
|
|
// Config struct holds benchmark configuration.
|
2019-09-26 01:02:29 +08:00
|
|
|
type Config struct {
|
|
|
|
MQTT mqttConfig `toml:"mqtt" mapstructure:"mqtt"`
|
|
|
|
Test testConfig `toml:"test" mapstructure:"test"`
|
|
|
|
Log logConfig `toml:"log" mapstructure:"log"`
|
|
|
|
Mf mainfluxFile `toml:"mainflux" mapstructure:"mainflux"`
|
|
|
|
}
|