config

package
v0.0.0-...-57fb5ef Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `mapstructure:"name"`
	Version string `mapstructure:"version"`
	BaseDir string `mapstructure:"base_dir"`
}

App represents the application configuration.

type Atmosphere

type Atmosphere struct {
	ISAConfiguration ISAConfiguration `mapstructure:"isa_configuration"`
}

Atmosphere represents the atmosphere configuration.

type Config

type Config struct {
	App        App        `mapstructure:"app"`
	Logging    Logging    `mapstructure:"logging"`
	External   External   `mapstructure:"external"`
	Options    Options    `mapstructure:"options"`
	Simulation Simulation `mapstructure:"simulation"`
}

Config represents the overall application configuration.

func GetConfig

func GetConfig() (*Config, error)

GetConfig returns the application configuration as a singleton

func (*Config) String

func (c *Config) String() map[string]string

String returns the configuration as a map of strings, useful for testing.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks the config to error on empty field

type External

type External struct {
	OpenRocketVersion string `mapstructure:"openrocket_version"`
}

External represents the external configuration.

type ISAConfiguration

type ISAConfiguration struct {
	SpecificGasConstant  float64 `mapstructure:"specific_gas_constant"`
	GravitationalAccel   float64 `mapstructure:"gravitational_accel"`
	SeaLevelDensity      float64 `mapstructure:"sea_level_density"`
	SeaLevelTemperature  float64 `mapstructure:"sea_level_temperature"`
	SeaLevelPressure     float64 `mapstructure:"sea_level_pressure"`
	RatioSpecificHeats   float64 `mapstructure:"ratio_specific_heats"`
	TemperatureLapseRate float64 `mapstructure:"temperature_lapse_rate"`
}

ISAConfiguration represents the ISA configuration.

type Launchrail

type Launchrail struct {
	Length      float64 `mapstructure:"length"`
	Angle       float64 `mapstructure:"angle"`
	Orientation float64 `mapstructure:"orientation"`
}

Launchrail represents the launchrail configuration.

type Launchsite

type Launchsite struct {
	Latitude   float64    `mapstructure:"latitude"`
	Longitude  float64    `mapstructure:"longitude"`
	Altitude   float64    `mapstructure:"altitude"`
	Atmosphere Atmosphere `mapstructure:"atmosphere"`
}

Launchsite represents the launchsite configuration.

type Logging

type Logging struct {
	Level string `mapstructure:"level"`
}

Logging represents the logging configuration.

type Options

type Options struct {
	MotorDesignation string     `mapstructure:"motor_designation"`
	OpenRocketFile   string     `mapstructure:"openrocket_file"`
	Launchrail       Launchrail `mapstructure:"launchrail"`
	Launchsite       Launchsite `mapstructure:"launchsite"`
}

Options represents the application options.

type Simulation

type Simulation struct {
	Step    float64 `mapstructure:"step"`
	MaxTime float64 `mapstructure:"max_time"`
}

Simulation represents the simulation configuration.

Jump to

Keyboard shortcuts

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