config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	ConfigDB        *MongoDB         `yaml:"configDB,omitempty"`
	Swagger         Swagger          `yaml:"swagger,omitempty"`
	Keycloak        *Keycloak        `yaml:"keycloak,omitempty"`
	LocationService *LocationService `yaml:"locationService,omitempty"`
	Cors            CorsConfig       `yaml:"cors,omitempty"`
}

Base config struct

func ParseConfig

func ParseConfig(filePath string) (*BaseConfig, error)

Parse YAML Config file from the provided config file path returns pointer to config structure and error if failed to generate the config struct. This also ensures handling scenarios when no config file is provided

func (*BaseConfig) GetConfigDB

func (c *BaseConfig) GetConfigDB() *MongoDB

get Config database information, if the struct is nil it ensures sending the default mongodb config for base development scenarios

func (*BaseConfig) GetKeycloakEndpoint

func (c *BaseConfig) GetKeycloakEndpoint() string

func (*BaseConfig) GetLocationServiceHost

func (c *BaseConfig) GetLocationServiceHost() string

GetLocationServiceHost returns the configured location service host

func (*BaseConfig) GetLocationServicePort

func (c *BaseConfig) GetLocationServicePort() string

GetLocationServicePort returns the configured location service port

func (*BaseConfig) GetSwaggerDir

func (c *BaseConfig) GetSwaggerDir() string

func (*BaseConfig) IsCORSEnabled

func (c *BaseConfig) IsCORSEnabled() bool

func (*BaseConfig) IsLocationServiceConfigured

func (c *BaseConfig) IsLocationServiceConfigured() bool

IsLocationServiceConfigured checks if location service is properly configured with both host and port values

type CorsConfig

type CorsConfig struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

type Keycloak

type Keycloak struct {
	Endpoint string `yaml:"endpoint,omitempty"`
}

type LocationService

type LocationService struct {
	Host string `yaml:"host,omitempty"`
	Port string `yaml:"port,omitempty"`
}

type MongoDB

type MongoDB struct {
	Uri string `yaml:"uri,omitempty"`
}

mongo db config struct

type Swagger

type Swagger struct {
	Dir string `yaml:"dir,omitempty"`
}

Jump to

Keyboard shortcuts

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