config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicStateConfig

type DynamicStateConfig struct {
	Sensors map[string][]EnvironmentSensorConfig `json:"sensors"`
	State   struct {
		Open struct {
			AllowedCredentials []HTTPBACredentialID `json:"allowed_credentials"`
		} `json:"open"`
	} `json:"state"`
}

type EnvironmentSensorConfig

type EnvironmentSensorConfig struct {
	SensorData         types.EnvironmentSensor `json:"sensor_data"`
	AllowedCredentials []HTTPBACredentialID    `json:"allowed_credentials"`
}

type HTTPBACredential

type HTTPBACredential struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type HTTPBACredentialID

type HTTPBACredentialID string

type HTTPBACredentials

type HTTPBACredentials map[HTTPBACredentialID]HTTPBACredential

type SpaceapidConfig

type SpaceapidConfig struct {
	// A list of username/password pairs for BasicAuth endpoints
	Credentials HTTPBACredentials `json:"credentials"`
	// The dynamic part of the spaceapi JSON
	Dynamic DynamicStateConfig `json:"dynamic"`
	// The static part of the spaceapi JSON
	Response types.SpaceAPIResponseV14 `json:"response"`
}

SpaceapidConfig is the representation of the config.json file

func ParseConfiguration

func ParseConfiguration() (conf SpaceapidConfig)

ParseConfiguration returns the config from file

Jump to

Keyboard shortcuts

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