config

package
v0.0.1-20230411-0002 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Name -> is the name of the instance... usually it's being used for logger or other things as naming...
	Name string
	// AutoReconnect -> Enable auto reconnection in case of disconnect!
	AutoReconnect string `yaml:"auto_reconnect" mapstructure:"auto_reconnect" default:"yes"`
	Reconnect     ReconnectOptions
	// UseMultipleConnections -> Enable utilization of existing listed connections, if the client cannot connect to previous, will take the next one!
	UseMultipleConnections string `yaml:"use_multiple_connections" mapstructure:"use_multiple_connections" default:"yes"`
	//Connections            map[string]*connection.Connection
	Connections []*connection.Connection
	// This is the logger configuration!
	Logger loggerConfig.Config
}

func DefaultConfig

func DefaultConfig(configObj *Config) (Config, error)

TODO: we should add connections, Reconnect options DefaultConfig -> it will return the default config with default values

type ReconnectOptions

type ReconnectOptions struct {
	// TimeoutSeconds -> 5 Seconds, after disconnect happened, the client will reconnect after
	// indicated time!
	TimeoutSeconds uint16 `yaml:"timeout_seconds" mapstructure:"timeout_seconds" default:"5"`
	// MaxRetries -> -1 -> infinite! Maximum nr of retries....
	MaxRetries int16 `yaml:"max_retries" mapstructure:"max_retries" default:"-1"`
}

Jump to

Keyboard shortcuts

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