config

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 8 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerURL *url.URL // MQTT server URL
	Auth      *authConf
	Store     *storeConf
	Group     string
	ClientID  string   // Client ID to use when connecting to server
	Topics    []string // Topic on which to publish messaged
	Qos       byte     // QOS to use when publishing

	KeepAlive         uint16        // seconds between keepalive packets
	ConnectRetryDelay time.Duration // Period between connection attempts

	QueuePath  string
	EnableGzip bool

	Debug bool // autopaho and paho debug output requested

	Logger *log.Logger
}

config holds the configuration

func GetConfigFromEnv added in v1.2.0

func GetConfigFromEnv() (*Config, error)

getConfig - Retrieves the configuration from the environment

func GetConfigFromEnvPrefixWithoutTopic added in v1.4.5

func GetConfigFromEnvPrefixWithoutTopic(prefix string) (*Config, error)

func GetConfigFromEnvWithoutTopic added in v1.2.0

func GetConfigFromEnvWithoutTopic() (*Config, error)

func GetConfigFromYaml added in v1.4.8

func GetConfigFromYaml(file string, service string) (*Config, error)

func (*Config) AddTopics added in v1.2.4

func (c *Config) AddTopics(topics ...string)

func (*Config) IsRawdata

func (c *Config) IsRawdata() bool

func (*Config) SetAuth

func (c *Config) SetAuth(user string, pass []byte)

func (*Config) SetStore added in v1.5.0

func (c *Config) SetStore(typ string, path string)

Jump to

Keyboard shortcuts

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