config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 5 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 {
	Server       ServerConfig
	Dashboard    DashboardConfig
	MQTT         MQTTConfig
	IdentityAuth IdentityAuthConfig `mapstructure:"auth"`
}

func InitConfig

func InitConfig() (*Config, error)

func InitViper

func InitViper() (*Config, error)

type DashboardConfig

type DashboardConfig struct {
	Title string
}

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	Name     string
	Timeout  time.Duration
}

type IdentityAuthConfig

type IdentityAuthConfig struct {
	KeyCloak KeyCloakConfig
}

type KeyCloakConfig

type KeyCloakConfig struct {
	BaseURL        string
	Realm          string
	ClientID       string `mapstructure:"client_id"`
	ClientSecret   string `mapstructure:"client_secret"`
	RealmPublicKey string `mapstructure:"realm_public_key"`
	Frontend       KeyCloakFrontendConfig
}

type KeyCloakFrontendConfig

type KeyCloakFrontendConfig struct {
	ClientID     string `mapstructure:"client_id"`
	ClientSecret string `mapstructure:"client_secret"`
	AuthURL      string `mapstructure:"auth_url"`
	TokenURL     string `mapstructure:"token_url"`
}

type LogConfig

type LogConfig struct {
	Level  logger.LogLevel
	Format logger.LogFormat
}

type MQTTConfig

type MQTTConfig struct {
	Broker   string
	ClientID string `mapstructure:"client_id"`
	Username string
	Password string
	Topic    string
}

type ServerConfig

type ServerConfig struct {
	Logs        LogConfig
	Database    DatabaseConfig
	Port        int
	Development bool
	AppURL      string `mapstructure:"app_url"`
}

Jump to

Keyboard shortcuts

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