Initial MVP commit
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
30
internal/platform/constants/constants.go
Normal file
30
internal/platform/constants/constants.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package constants
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
// ObservationWindow defines how far back observations are queried.
|
||||
ObservationWindow = 30 * time.Minute
|
||||
|
||||
// ForecastQueryLimit defines the max forecast periods returned.
|
||||
ForecastQueryLimit = 5
|
||||
|
||||
// DefaultOutputUnitSystem is the API's default output unit system.
|
||||
DefaultOutputUnitSystem = "us"
|
||||
|
||||
// DefaultHTTPAddr is the default listen address for the HTTP server.
|
||||
DefaultHTTPAddr = ":8080"
|
||||
)
|
||||
|
||||
var SupportedTimestampLayouts = []string{
|
||||
time.RFC3339Nano,
|
||||
time.RFC3339,
|
||||
}
|
||||
|
||||
const (
|
||||
TempFahrenheitPrecision = 1
|
||||
WindMphPrecision = 1
|
||||
|
||||
KmhPerMph = 1.609344
|
||||
MphPerKmh = 1 / KmhPerMph
|
||||
)
|
||||
17
internal/platform/constants/conversion.go
Normal file
17
internal/platform/constants/conversion.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package constants
|
||||
|
||||
func CelsiusToFahrenheit(c float64) float64 {
|
||||
return c*9.0/5.0 + 32.0
|
||||
}
|
||||
|
||||
func FahrenheitToCelsius(f float64) float64 {
|
||||
return (f - 32.0) * 5.0 / 9.0
|
||||
}
|
||||
|
||||
func KmhToMph(kmh float64) float64 {
|
||||
return kmh * MphPerKmh
|
||||
}
|
||||
|
||||
func MphToKmh(mph float64) float64 {
|
||||
return mph * KmhPerMph
|
||||
}
|
||||
Reference in New Issue
Block a user