config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: AGPL-3.0 Imports: 7 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       `mapstructure:"server"`
	Dashboard    DashboardConfig    `mapstructure:"dashboard"`
	Routing      RoutingConfig      `mapstructure:"routing"`
	S3           S3Config           `mapstructure:"s3"`
	MQTT         MQTTConfig         `mapstructure:"mqtt"`
	IdentityAuth IdentityAuthConfig `mapstructure:"auth"`
	Map          MapConfig          `mapstructure:"map"`
}

func InitConfig

func InitConfig() (*Config, error)

func InitViper

func InitViper() (*Config, error)

type DashboardConfig

type DashboardConfig struct {
	Title string `mapstructure:"title"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Host     string        `mapstructure:"host"`
	Port     int           `mapstructure:"port"`
	Username string        `mapstructure:"username"`
	Password string        `mapstructure:"password"`
	Name     string        `mapstructure:"name"`
	Timeout  time.Duration `mapstructure:"timeout"`
}

type IdentityAuthConfig

type IdentityAuthConfig struct {
	Enable       bool         `mapstructure:"enable"`
	OidcProvider OidcProvider `mapstructure:"oidc_provider"`
}

type LogConfig

type LogConfig struct {
	Level  logger.LogLevel  `mapstructure:"level"`
	Format logger.LogFormat `mapstructure:"format"`
}

type MQTTConfig

type MQTTConfig struct {
	Enable   bool   `mapstructure:"enable"`
	Broker   string `mapstructure:"broker"`
	ClientID string `mapstructure:"client_id"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Topic    string `mapstructure:"topic"`
}

type MapConfig

type MapConfig struct {
	Center [2]float64 `mapstructure:"center"`
	BBox   [4]float64 `mapstructure:"bbox"`
}

type OidcClient

type OidcClient struct {
	ClientID     string `mapstructure:"client_id"`
	ClientSecret string `mapstructure:"client_secret"`
}

type OidcProvider

type OidcProvider struct {
	BaseURL    string        `mapstructure:"base_url"`
	DomainName string        `mapstructure:"domain_name"`
	AuthURL    string        `mapstructure:"auth_url"`
	TokenURL   string        `mapstructure:"token_url"`
	PublicKey  OidcPublicKey `mapstructure:"public_key"`
	Frontend   OidcClient    `mapstructure:"frontend"`
	Backend    OidcClient    `mapstructure:"backend"`
}

type OidcPublicKey

type OidcPublicKey struct {
	StaticKey string `mapstructure:"static"`
}

type RoutingConfig

type RoutingConfig struct {
	Enable        bool                  `mapstructure:"enable"`
	StartPoint    []float64             `mapstructure:"start_point"`
	EndPoint      []float64             `mapstructure:"end_point"`
	WateringPoint []float64             `mapstructure:"watering_point"`
	Ors           RoutingOrsConfig      `mapstructure:"ors"`
	Valhalla      RoutingValhallaConfig `mapstructure:"valhalla"`
}

type RoutingOrsConfig

type RoutingOrsConfig struct {
	Host         string                       `mapstructure:"host"`
	Optimization RoutingOrsOptimizationConfig `mapstructure:"optimization"`
}

type RoutingOrsOptimizationConfig

type RoutingOrsOptimizationConfig struct {
	Vroom RoutingVroomConfig `mapstructure:"vroom"`
}

type RoutingValhallaConfig

type RoutingValhallaConfig struct {
	Host         string                            `mapstructure:"host"`
	Optimization RoutingValhallaOptimizationConfig `mapstructure:"optimization"`
}

type RoutingValhallaOptimizationConfig

type RoutingValhallaOptimizationConfig struct {
	Vroom RoutingVroomConfig `mapstructure:"vroom"`
}

type RoutingVroomConfig

type RoutingVroomConfig struct {
	Host string `mapstructure:"host"`
}

type S3Config

type S3Config struct {
	Enable   bool            `mapstructure:"enable"`
	Endpoint string          `mapstructure:"endpoint"`
	Region   string          `mapstructure:"region"`
	RouteGpx S3ServiceConfig `mapstructure:"route-gpx"`
	UseSSL   bool            `mapstructure:"use_ssl"`
}

type S3ServiceConfig

type S3ServiceConfig struct {
	Bucket          string `mapstructure:"bucket"`
	AccessKey       string `mapstructure:"accessKey"`
	SecretAccessKey string `mapstructure:"secretAccessKey"`
}

type ServerConfig

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

Jump to

Keyboard shortcuts

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