pcmt/config/schema/validate.dhall
leo bfafc4a8be
All checks were successful
continuous-integration/drone/push Build is passing
config: update schema
* couple session-related attrs in a record
* couple logger-pertaining attrs in a record
* update config Go representation
* update Go config consumers
2023-05-05 19:31:43 +02:00

28 lines
799 B
Haskell

let Prelude =
{- this will have to get bumped when prelude is updated -}
./prelude.dhall
sha256:a6036bc38d883450598d1de7c98ead113196fe2db02e9733855668b18096f07b
let Schema =
./schema.dhall
sha256:3269ff2c6eba9856b819f3e7fccd44f2745fdff9d02498e6f0a1474ce650af17
? ./schema.dhall
let Schema/validate
: Schema.Type -> Type
=
-- | define validation.
\(c : Schema.Type) ->
let expected = { validPort = True }
let actual =
{ validPort =
-- | make sure port number belongs to the <1;65535> range.
Prelude.Natural.lessThanEqual 1 c.Port
&& Prelude.Natural.lessThanEqual c.Port 65535
}
in expected === actual
in Schema/validate