graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Server.Init.Env

Synopsis

Documentation

considerEnv :: (Monad m, FromEnv a) => String -> WithEnvT m (Maybe a) Source #

Lookup a key in the application environment then parse the value with a FromEnv instance'

considerEnvs :: (Monad m, FromEnv a) => [String] -> WithEnvT m (Maybe a) Source #

Lookup a list of keys with considerEnv and return the first value to parse successfully.

withOptions :: (Monad m, FromEnv option) => Maybe option -> [Option ()] -> WithEnvT m (Maybe option) Source #

Lookup a list of keys with withOption and return the first value to parse successfully.

withOption :: (Monad m, FromEnv option) => Maybe option -> Option () -> WithEnvT m (Maybe option) Source #

Given the parse result for an option and the 'Option def' record for that option, query the environment, and then merge the results from the parser and environment.

withOptionDefault :: (Monad m, FromEnv option) => Maybe option -> Option option -> WithEnvT m option Source #

Given the parse result for an option and the 'Option def' record for that option, query the environment, and then merge the results from the parser, environment, and the default.

withOptionSwitch :: Monad m => Bool -> Option Bool -> WithEnvT m Bool Source #

Switches in 'optparse-applicative' have different semantics then ordinary flags. They are always optional and produce a False when absent rather then a Nothing.

In HGE we give Env Vars a higher precedence then an absent Switch but the ordinary withEnv operation expects a Nothing for an absent arg parser result.

This function executes with 'withOption Nothing' when the Switch is absent, otherwise it returns True.

An alternative solution would be to make Switches return 'Maybe _', where '_' is an option specific sum type. This would allow us to use withOptionDefault directly. Additionally, all fields of ServeOptionsRaw would become Maybe or First values which would allow us to write a 'Monoid ServeOptionsRaw' instance for combing different option sources.

class FromEnv a where Source #

A Read style parser used for consuming Env Vars and building ReadM parsers for 'optparse-applicative'.

Instances

Instances details
FromEnv Bool Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv Int Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv String Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv Text Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String Text Source #

FromEnv NominalDiffTime Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv DiffTime Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv Milliseconds Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv Seconds Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv LogLevel Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv RemoteSchemaPermissions Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv InferFunctionPermissions Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv DangerouslyCollapseBooleans Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv StringifyNumbers Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv CacheSize Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv TxIsolation Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String TxIsolation Source #

FromEnv URLTemplate Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv CorsConfig Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv RoleName Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv JWTConfig Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv ExtensionsSchema Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv NonNegativeDiffTime Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv PositiveInt Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv NonNegativeInt Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv RefetchInterval Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv BatchSize Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv NamingCase Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv MetadataQueryLoggingMode Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv AuthHookType Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv AdminSecretHash Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv HostPreference Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String HostPreference Source #

FromEnv WSConnectionInitTimeout Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv KeepAliveDelay Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv OptionalInterval Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv Port Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv [JWTConfig] Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv a => FromEnv (Maybe a) Source # 
Instance details

Defined in Hasura.Server.Init.Env

EnabledLogTypes impl => FromEnv (HashSet (EngineLogType impl)) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String (HashSet (EngineLogType impl)) Source #

FromEnv (HashSet ExperimentalFeature) Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv (HashSet API) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fromEnv :: String -> Either String (HashSet API) Source #

(Num a, Ord a, FromEnv a) => FromEnv (NonNegative a) Source # 
Instance details

Defined in Hasura.Server.Init.Env

FromEnv (MaintenanceMode ()) Source # 
Instance details

Defined in Hasura.Server.Init.Env

newtype WithEnvT m a Source #

The monadic context for querying Env Vars.

Constructors

WithEnvT 

Instances

Instances details
MonadTrans WithEnvT Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

lift :: Monad m => m a -> WithEnvT m a #

Monad m => MonadError String (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

throwError :: String -> WithEnvT m a #

catchError :: WithEnvT m a -> (String -> WithEnvT m a) -> WithEnvT m a #

Monad m => Monad (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

(>>=) :: WithEnvT m a -> (a -> WithEnvT m b) -> WithEnvT m b #

(>>) :: WithEnvT m a -> WithEnvT m b -> WithEnvT m b #

return :: a -> WithEnvT m a #

Functor m => Functor (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

fmap :: (a -> b) -> WithEnvT m a -> WithEnvT m b #

(<$) :: a -> WithEnvT m b -> WithEnvT m a #

Monad m => Applicative (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

pure :: a -> WithEnvT m a #

(<*>) :: WithEnvT m (a -> b) -> WithEnvT m a -> WithEnvT m b #

liftA2 :: (a -> b -> c) -> WithEnvT m a -> WithEnvT m b -> WithEnvT m c #

(*>) :: WithEnvT m a -> WithEnvT m b -> WithEnvT m b #

(<*) :: WithEnvT m a -> WithEnvT m b -> WithEnvT m a #

MonadIO m => MonadIO (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

liftIO :: IO a -> WithEnvT m a #

MFunctor WithEnvT Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> WithEnvT m b -> WithEnvT n b

Monad m => MonadReader [(String, String)] (WithEnvT m) Source # 
Instance details

Defined in Hasura.Server.Init.Env

Methods

ask :: WithEnvT m [(String, String)] #

local :: ([(String, String)] -> [(String, String)]) -> WithEnvT m a -> WithEnvT m a #

reader :: ([(String, String)] -> a) -> WithEnvT m a #

runWithEnv :: [(String, String)] -> WithEnv a -> Either String a Source #

Given an environment run a WithEnv action producing either a parse error or an a.

runWithEnvT :: [(String, String)] -> WithEnvT m a -> m (Either String a) Source #

Given an environment run a WithEnvT action producing either a parse error or an a.