Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data HostManager
- type Reservations = Set Host
- reserveHosts :: (LogMessage -> IO ()) -> HostManager -> AppId -> Set Host -> IO Reservations
- forgetReservations :: (LogMessage -> IO ()) -> HostManager -> AppId -> Reservations -> IO ()
- activateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Map Host (ProxyAction, Credentials) -> IO ()
- deactivateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Set Host -> IO ()
- reactivateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Map Host (ProxyAction, Credentials) -> Set Host -> IO ()
- lookupAction :: HostManager -> HostBS -> IO (Maybe (ProxyAction, Credentials))
- start :: IO HostManager
Types
data HostManager Source #
type Reservations = Set Host Source #
Actions
reserveHosts :: (LogMessage -> IO ()) -> HostManager -> AppId -> Set Host -> IO Reservations Source #
Reserve the given hosts so that no other application may use them. Does not yet enable any action. The semantics are:
- If a requested host is currently actively used or by an app of the same name, it is considered reserved.
- If a requested host is currently reserved by an app of the same name, it is considered an error in calling this API. Only one app reservation can happen at a time.
- If any requested host is currently used or reserved by an app with a
different name, then those values are returned as
Left
. - Otherwise, the hosts which were reserved are returned as
Right
. This does not include previously active hosts.
forgetReservations :: (LogMessage -> IO ()) -> HostManager -> AppId -> Reservations -> IO () Source #
Forget previously made reservations.
activateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Map Host (ProxyAction, Credentials) -> IO () Source #
Activate a new app. Note that you must first reserve the hostnames you'll be using.
deactivateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Set Host -> IO () Source #
reactivateApp :: (LogMessage -> IO ()) -> HostManager -> AppId -> Map Host (ProxyAction, Credentials) -> Set Host -> IO () Source #
lookupAction :: HostManager -> HostBS -> IO (Maybe (ProxyAction, Credentials)) Source #
Initialize
start :: IO HostManager Source #