configure

package
v0.0.0-...-f2b9f5f Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindEnvs

func BindEnvs(config *viper.Viper, iface interface{}, parts ...string)

Types

type Config

type Config struct {
	Level      string `mapstructure:"level" json:"level"`
	ConfigFile string `mapstructure:"config_file" json:"config_file"`
	NoHeader   bool   `mapstructure:"noheader" json:"noheader"`

	Redis struct {
		Username   string   `mapstructure:"username" json:"username"`
		Password   string   `mapstructure:"password" json:"password"`
		Addresses  []string `mapstructure:"addresses" json:"addresses"`
		Database   int      `mapstructure:"database" json:"database"`
		Sentinel   bool     `mapstructure:"sentinel" json:"sentinel"`
		MasterName string   `mapstructure:"master_name" json:"master_name"`
	} `mapstructure:"redis" json:"redis"`

	Nats struct {
		Url     string `mapstructure:"url" json:"url"`
		Subject string `mapstructure:"subject" json:"subject"`
	} `mapstructure:"nats" json:"nats"`

	API struct {
		Enabled           bool   `mapstructure:"enabled" json:"enabled"`
		Bind              string `mapstructure:"bind" json:"bind"`
		HeartbeatInterval uint32 `mapstructure:"heartbeat_interval" json:"heartbeat_interval"`
		SubscriptionLimit int32  `mapstructure:"subscription_limit" json:"subscription_limit"`
		ConnectionLimit   int32  `mapstructure:"connection_limit" json:"connection_limit"`
		// Connection time limit in minutes
		TTL int `mapstructure:"ttl" json:"ttl"`

		V1 bool `mapstructure:"v1" json:"v1"`
		V3 bool `mapstructure:"v3" json:"v3"`

		// URL to the eventbridge api
		BridgeURL string `mapstructure:"bridge_url" json:"bridge_url"`
	} `mapstructure:"api" json:"api"`

	Monitoring struct {
		Enabled bool       `mapstructure:"enabled" json:"enabled"`
		Bind    string     `mapstructure:"bind" json:"bind"`
		Labels  []KeyValue `mapstructure:"labels" json:"labels"`
	} `mapstructure:"monitoring" json:"monitoring"`

	PProf struct {
		Enabled bool   `mapstructure:"enabled" json:"enabled"`
		Bind    string `mapstructure:"bind" json:"bind"`
	} `mapstructure:"pprof" json:"pprof"`

	Health struct {
		Enabled bool   `mapstructure:"enabled" json:"enabled"`
		Bind    string `mapstructure:"bind" json:"bind"`
	} `mapstructure:"health" json:"health"`

	Pod struct {
		Name string `mapstructure:"name" json:"name"`
	} `mapstructure:"pod" json:"pod"`
}

func New

func New() *Config

type KeyValue

type KeyValue struct {
	Key   string `mapstructure:"key" json:"key"`
	Value string `mapstructure:"value" json:"value"`
}

Jump to

Keyboard shortcuts

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