Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cachix.API.WebSocketSubprotocol
Synopsis
- data Message cmd = Message {}
- data Cache = Cache {}
- data AgentInformation = AgentInformation {}
- data DeploymentDetails = DeploymentDetails {}
- data BackendCommand
- data AgentCommand
- = DeploymentStarted { }
- | DeploymentFinished { }
- parseMessage :: FromJSON cmd => ByteString -> Either Text (Message cmd)
- sendMessage :: ToJSON cmd => Connection -> Message cmd -> IO ()
- receiveDataConcurrently :: Connection -> (ByteString -> IO ()) -> IO ()
- data Log = Log {}
Documentation
Instances
Instances
FromJSON Cache Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol | |||||
ToJSON Cache Source # | |||||
Generic Cache Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
| |||||
Show Cache Source # | |||||
Eq Cache Source # | |||||
type Rep Cache Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep Cache = D1 ('MetaData "Cache" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "Cache" 'PrefixI 'True) (S1 ('MetaSel ('Just "cacheName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "publicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "isPublic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
data AgentInformation Source #
Instances
FromJSON AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods parseJSON :: Value -> Parser AgentInformation # parseJSONList :: Value -> Parser [AgentInformation] # | |||||
ToJSON AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods toJSON :: AgentInformation -> Value # toEncoding :: AgentInformation -> Encoding # toJSONList :: [AgentInformation] -> Value # toEncodingList :: [AgentInformation] -> Encoding # omitField :: AgentInformation -> Bool # | |||||
Generic AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
Methods from :: AgentInformation -> Rep AgentInformation x # to :: Rep AgentInformation x -> AgentInformation # | |||||
Show AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods showsPrec :: Int -> AgentInformation -> ShowS # show :: AgentInformation -> String # showList :: [AgentInformation] -> ShowS # | |||||
Eq AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods (==) :: AgentInformation -> AgentInformation -> Bool # (/=) :: AgentInformation -> AgentInformation -> Bool # | |||||
type Rep AgentInformation Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep AgentInformation = D1 ('MetaData "AgentInformation" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "AgentInformation" 'PrefixI 'True) (S1 ('MetaSel ('Just "cache") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Cache)) :*: S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID))) |
data DeploymentDetails Source #
Constructors
DeploymentDetails | |
Instances
FromJSON DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods parseJSON :: Value -> Parser DeploymentDetails # parseJSONList :: Value -> Parser [DeploymentDetails] # | |||||
ToJSON DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods toJSON :: DeploymentDetails -> Value # toEncoding :: DeploymentDetails -> Encoding # toJSONList :: [DeploymentDetails] -> Value # toEncodingList :: [DeploymentDetails] -> Encoding # omitField :: DeploymentDetails -> Bool # | |||||
Generic DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
Methods from :: DeploymentDetails -> Rep DeploymentDetails x # to :: Rep DeploymentDetails x -> DeploymentDetails # | |||||
Show DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods showsPrec :: Int -> DeploymentDetails -> ShowS # show :: DeploymentDetails -> String # showList :: [DeploymentDetails] -> ShowS # | |||||
Eq DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods (==) :: DeploymentDetails -> DeploymentDetails -> Bool # (/=) :: DeploymentDetails -> DeploymentDetails -> Bool # | |||||
type Rep DeploymentDetails Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep DeploymentDetails = D1 ('MetaData "DeploymentDetails" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "DeploymentDetails" 'PrefixI 'True) ((S1 ('MetaSel ('Just "storePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID)) :*: (S1 ('MetaSel ('Just "index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64) :*: S1 ('MetaSel ('Just "rollbackScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) |
data BackendCommand Source #
Constructors
Deployment DeploymentDetails | |
AgentRegistered AgentInformation |
Instances
FromJSON BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods parseJSON :: Value -> Parser BackendCommand # parseJSONList :: Value -> Parser [BackendCommand] # | |||||
ToJSON BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods toJSON :: BackendCommand -> Value # toEncoding :: BackendCommand -> Encoding # toJSONList :: [BackendCommand] -> Value # toEncodingList :: [BackendCommand] -> Encoding # omitField :: BackendCommand -> Bool # | |||||
Generic BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
Methods from :: BackendCommand -> Rep BackendCommand x # to :: Rep BackendCommand x -> BackendCommand # | |||||
Show BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods showsPrec :: Int -> BackendCommand -> ShowS # show :: BackendCommand -> String # showList :: [BackendCommand] -> ShowS # | |||||
Eq BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods (==) :: BackendCommand -> BackendCommand -> Bool # (/=) :: BackendCommand -> BackendCommand -> Bool # | |||||
type Rep BackendCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep BackendCommand = D1 ('MetaData "BackendCommand" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "Deployment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DeploymentDetails)) :+: C1 ('MetaCons "AgentRegistered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AgentInformation))) |
data AgentCommand Source #
Constructors
DeploymentStarted | |
DeploymentFinished | |
Instances
FromJSON AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol | |||||
ToJSON AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods toJSON :: AgentCommand -> Value # toEncoding :: AgentCommand -> Encoding # toJSONList :: [AgentCommand] -> Value # toEncodingList :: [AgentCommand] -> Encoding # omitField :: AgentCommand -> Bool # | |||||
Generic AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
| |||||
Show AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Methods showsPrec :: Int -> AgentCommand -> ShowS # show :: AgentCommand -> String # showList :: [AgentCommand] -> ShowS # | |||||
Eq AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol | |||||
type Rep AgentCommand Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep AgentCommand = D1 ('MetaData "AgentCommand" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "DeploymentStarted" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID) :*: (S1 ('MetaSel ('Just "time") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "closureSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int64)))) :+: C1 ('MetaCons "DeploymentFinished" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UUID) :*: (S1 ('MetaSel ('Just "time") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "hasSucceeded") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) |
parseMessage :: FromJSON cmd => ByteString -> Either Text (Message cmd) Source #
sendMessage :: ToJSON cmd => Connection -> Message cmd -> IO () Source #
receiveDataConcurrently :: Connection -> (ByteString -> IO ()) -> IO () Source #
Receive and process messages in parallel.
Note: This will not rethrow the CloseRequest
exception!
TODO: use Async.replicateConcurrently
Instances
FromJSON Log Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol | |||||
ToJSON Log Source # | |||||
Generic Log Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol Associated Types
| |||||
Show Log Source # | |||||
type Rep Log Source # | |||||
Defined in Cachix.API.WebSocketSubprotocol type Rep Log = D1 ('MetaData "Log" "Cachix.API.WebSocketSubprotocol" "cachix-api-1.8.0-9sZEmYO3Ydd7Ri76UT4hpf" 'False) (C1 ('MetaCons "Log" 'PrefixI 'True) (S1 ('MetaSel ('Just "line") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "time") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime))) |