config

package
v0.0.0-...-71b9f4c Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAddress

func GenerateAddress(protocol string, hostname string, port int) string

func IsFileEmpty

func IsFileEmpty(path string) (bool, error)

func PortToAddress

func PortToAddress(port int) string

func ToToml

func ToToml(v any) (string, error)

Types

type AuthConfig

type AuthConfig struct {
	Username string `toml:"username"`
	Password string `toml:"password"`
}

type ControlConfiguration

type ControlConfiguration struct {
	Timeouts Timeouts   `toml:"timeouts"`
	Server   Server     `toml:"server"`
	Database Database   `toml:"database"`
	Auth     AuthConfig `toml:"auth"`
	SSH      SSHConf    `toml:"onboard"` // TODO: Change name to ssh_configuration, deferred due to it being a breaking change
}

func DefaultControlConfiguration

func DefaultControlConfiguration() ControlConfiguration

func GetControl

func GetControl(filename string) (ControlConfiguration, error)

type Database

type Database struct {
	InMemory           bool          `toml:"inmemory"`
	Postgres           bool          `toml:"postgres"`
	PostgresUrl        string        `toml:"url"`
	DownsampleInterval time.Duration `toml:"downsample_interval"`
}

type Groundstation

type Groundstation struct {
	Protocol string `toml:"protocol"`
	Hostname string `toml:"hostname"`
	Port     int    `toml:"port"`
}

type SSHConf

type SSHConf struct {
	DataDir    string                 `toml:"datadir"`
	KeyPath    string                 `toml:"keyfile"`
	Username   string                 `toml:"username"`
	RemoteConf SatelliteConfiguration `toml:"remote"`
}

type Satellite

type Satellite struct {
	Cache             string        `toml:"cache"`
	DataInterval      time.Duration `toml:"data_interval"`
	HeartbeatInterval time.Duration `toml:"heartbeat_interval"`
	FakeGPU           bool          `toml:"fake_gpu"`
}

type SatelliteConfiguration

type SatelliteConfiguration struct {
	Groundstation Groundstation `toml:"groundstation"`
	Satellite     Satellite     `toml:"satellite"`
}

func DefaultSatelliteConfiguration

func DefaultSatelliteConfiguration() SatelliteConfiguration

func GetSatellite

func GetSatellite(filename string) (SatelliteConfiguration, error)

type Server

type Server struct {
	GSPort int `toml:"groundstation_port"`
	WAPort int `toml:"webapi_port"`
}

type Timeouts

type Timeouts struct {
	DeathTimeout_    time.Duration `toml:"death_timeout"`
	MonitorInterval_ time.Duration `toml:"monitor_interval"`
}

func (Timeouts) DeathTimeout

func (t Timeouts) DeathTimeout() time.Duration

func (Timeouts) MonitorInterval

func (t Timeouts) MonitorInterval() time.Duration

Jump to

Keyboard shortcuts

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