-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Servant HTTP API specification for https://cachix.org -- -- Servant HTTP API specification for https://cachix.org @package cachix-api @version 0.6.0 module Cachix.API.Error escalate :: (Exception exc, MonadThrow m) => Either exc a -> m a -- | Examples: > escalate . maybeToEither err404 -- -- | Note that exceptions gets handled by warp and logged (user sees just -- "Internal server") escalateAs :: (Exception exc, MonadThrow m) => (l -> exc) -> Either l a -> m a module Cachix.API.Signing fingerprint :: Text -> Text -> Integer -> [Text] -> ByteString passthroughSizeSink :: MonadIO m => IORef Integer -> ConduitT ByteString ByteString m () passthroughHashSinkB16 :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m () passthroughHashSink :: MonadIO m => IORef ByteString -> ConduitT ByteString ByteString m () module Cachix.Types.ByteStringStreaming newtype ByteStringStreaming ByteStringStreaming :: ByteString -> ByteStringStreaming newtype LazyByteStringStreaming LazyByteStringStreaming :: ByteString -> LazyByteStringStreaming instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.ByteStringStreaming.LazyByteStringStreaming instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.ByteStringStreaming.ByteStringStreaming module Cachix.Types.NarFileName -- | hash.nar.extension file data NarFileName NarFileName :: Text -> Text -> NarFileName [contentHash] :: NarFileName -> Text [extension] :: NarFileName -> Text instance GHC.Generics.Generic Cachix.Types.NarFileName.NarFileName instance Web.Internal.HttpApiData.FromHttpApiData Cachix.Types.NarFileName.NarFileName instance Web.Internal.HttpApiData.ToHttpApiData Cachix.Types.NarFileName.NarFileName instance Data.Swagger.Internal.ParamSchema.ToParamSchema Cachix.Types.NarFileName.NarFileName module Cachix.Types.NarInfo type CachixNarInfo = NarInfo Text Text Text data NarInfo fp txt hash NarInfo :: fp -> txt -> txt -> hash -> Integer -> hash -> Integer -> Set fp -> Maybe txt -> Maybe txt -> Maybe txt -> Maybe txt -> NarInfo fp txt hash [storePath] :: NarInfo fp txt hash -> fp [url] :: NarInfo fp txt hash -> txt [compression] :: NarInfo fp txt hash -> txt [fileHash] :: NarInfo fp txt hash -> hash [fileSize] :: NarInfo fp txt hash -> Integer [narHash] :: NarInfo fp txt hash -> hash [narSize] :: NarInfo fp txt hash -> Integer [references] :: NarInfo fp txt hash -> Set fp [deriver] :: NarInfo fp txt hash -> Maybe txt [system] :: NarInfo fp txt hash -> Maybe txt [sig] :: NarInfo fp txt hash -> Maybe txt [ca] :: NarInfo fp txt hash -> Maybe txt instance Data.Swagger.Internal.Schema.ToSchema (Nix.NarInfo.Types.NarInfo Data.Text.Internal.Text Data.Text.Internal.Text Data.Text.Internal.Text) instance Data.Aeson.Types.ToJSON.ToJSON (Nix.NarInfo.Types.NarInfo Data.Text.Internal.Text Data.Text.Internal.Text Data.Text.Internal.Text) instance Data.Aeson.Types.FromJSON.FromJSON (Nix.NarInfo.Types.NarInfo Data.Text.Internal.Text Data.Text.Internal.Text Data.Text.Internal.Text) instance Control.DeepSeq.NFData (Nix.NarInfo.Types.NarInfo Data.Text.Internal.Text Data.Text.Internal.Text Data.Text.Internal.Text) module Cachix.Types.NarInfoCreate -- | Client create type data NarInfoCreate NarInfoCreate :: Text -> Text -> Text -> Integer -> Text -> Integer -> [Text] -> Text -> Maybe Text -> NarInfoCreate -- | $storePrefix / $storeHash - $storeSuffix [cStoreHash] :: NarInfoCreate -> Text -- | $storePrefix / $storeHash - $storeSuffix [cStoreSuffix] :: NarInfoCreate -> Text [cNarHash] :: NarInfoCreate -> Text [cNarSize] :: NarInfoCreate -> Integer [cFileHash] :: NarInfoCreate -> Text [cFileSize] :: NarInfoCreate -> Integer [cReferences] :: NarInfoCreate -> [Text] [cDeriver] :: NarInfoCreate -> Text [cSig] :: NarInfoCreate -> Maybe Text data NarInfoInvalid isNarInfoCreateValid :: NarInfoCreate -> Either NarInfoInvalid () instance GHC.Exception.Type.Exception Cachix.Types.NarInfoCreate.NarInfoInvalid instance GHC.Show.Show Cachix.Types.NarInfoCreate.NarInfoInvalid instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.NarInfoCreate.NarInfoCreate instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.NarInfoCreate.NarInfoCreate instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.NarInfoCreate.NarInfoCreate instance GHC.Show.Show Cachix.Types.NarInfoCreate.NarInfoCreate instance GHC.Generics.Generic Cachix.Types.NarInfoCreate.NarInfoCreate module Cachix.Types.NarInfoHash -- | Store path hash newtype NarInfoHash NarInfoHash :: Text -> NarInfoHash [unnarinfohash] :: NarInfoHash -> Text instance Data.Swagger.Internal.ParamSchema.ToParamSchema Cachix.Types.NarInfoHash.NarInfoHash instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.NarInfoHash.NarInfoHash instance GHC.Generics.Generic Cachix.Types.NarInfoHash.NarInfoHash instance Web.Internal.HttpApiData.FromHttpApiData Cachix.Types.NarInfoHash.NarInfoHash instance Web.Internal.HttpApiData.ToHttpApiData Cachix.Types.NarInfoHash.NarInfoHash module Cachix.Types.NixCacheInfo data NixCacheInfo NixCacheInfo :: Text -> Integer -> Integer -> NixCacheInfo [storeDir] :: NixCacheInfo -> Text [wantMassQuery] :: NixCacheInfo -> Integer [priority] :: NixCacheInfo -> Integer instance Control.DeepSeq.NFData Cachix.Types.NixCacheInfo.NixCacheInfo instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.NixCacheInfo.NixCacheInfo instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.NixCacheInfo.NixCacheInfo instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.NixCacheInfo.NixCacheInfo instance GHC.Show.Show Cachix.Types.NixCacheInfo.NixCacheInfo instance GHC.Generics.Generic Cachix.Types.NixCacheInfo.NixCacheInfo module Cachix.Types.ContentTypes data XNixNar data XNixNarInfo data XNixCacheInfo instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixCacheInfo instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixCacheInfo Cachix.Types.NixCacheInfo.NixCacheInfo instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixNarInfo instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixNarInfo Cachix.Types.NarInfo.CachixNarInfo instance Servant.API.ContentTypes.Accept Cachix.Types.ContentTypes.XNixNar instance Servant.API.ContentTypes.MimeRender Cachix.Types.ContentTypes.XNixNar Cachix.Types.ByteStringStreaming.ByteStringStreaming instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixNar Cachix.Types.ByteStringStreaming.ByteStringStreaming instance Servant.API.ContentTypes.MimeUnrender Cachix.Types.ContentTypes.XNixNar Cachix.Types.ByteStringStreaming.LazyByteStringStreaming instance Servant.API.ContentTypes.MimeRender Cachix.Types.ContentTypes.XNixNar Cachix.Types.ByteStringStreaming.LazyByteStringStreaming module Cachix.Types.Permission data Permission Read :: Permission Write :: Permission Admin :: Permission instance GHC.Classes.Ord Cachix.Types.Permission.Permission instance GHC.Classes.Eq Cachix.Types.Permission.Permission instance Control.DeepSeq.NFData Cachix.Types.Permission.Permission instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.Permission.Permission instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.Permission.Permission instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.Permission.Permission instance GHC.Show.Show Cachix.Types.Permission.Permission instance GHC.Generics.Generic Cachix.Types.Permission.Permission module Cachix.Types.BinaryCache data BinaryCache BinaryCache :: Text -> Text -> Bool -> [Text] -> Text -> Permission -> BinaryCache [name] :: BinaryCache -> Text [uri] :: BinaryCache -> Text [isPublic] :: BinaryCache -> Bool [publicSigningKeys] :: BinaryCache -> [Text] [githubUsername] :: BinaryCache -> Text [permission] :: BinaryCache -> Permission instance Control.DeepSeq.NFData Cachix.Types.BinaryCache.BinaryCache instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.BinaryCache.BinaryCache instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.BinaryCache.BinaryCache instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.BinaryCache.BinaryCache instance GHC.Generics.Generic Cachix.Types.BinaryCache.BinaryCache instance GHC.Show.Show Cachix.Types.BinaryCache.BinaryCache -- | Servant specific additions that could be upstreamed module Cachix.Types.Servant type Get302 (cts :: [Type]) (hs :: [Type]) = Verb 'GET 302 cts (Headers (Header "Location" Text : hs) NoContent) type Post302 (cts :: [Type]) (hs :: [Type]) = Verb 'POST 302 cts (Headers (Header "Location" Text : hs) NoContent) type Head = Verb 'HEAD 200 '[JSON] NoContent -- | Auth representations module Cachix.Types.Session data Session JWTSession :: ClaimsSet -> Session instance GHC.Classes.Eq Cachix.Types.Session.Session instance Servant.Auth.JWT.ToJWT Cachix.Types.Session.Session instance Servant.Auth.JWT.FromJWT Cachix.Types.Session.Session module Cachix.Types.SigningKeyCreate -- | Conveys that a signing secret key was created, by sharing the public -- key. newtype SigningKeyCreate SigningKeyCreate :: Text -> SigningKeyCreate [publicKey] :: SigningKeyCreate -> Text instance Data.Swagger.Internal.Schema.ToSchema Cachix.Types.SigningKeyCreate.SigningKeyCreate instance Data.Aeson.Types.ToJSON.ToJSON Cachix.Types.SigningKeyCreate.SigningKeyCreate instance Data.Aeson.Types.FromJSON.FromJSON Cachix.Types.SigningKeyCreate.SigningKeyCreate instance GHC.Generics.Generic Cachix.Types.SigningKeyCreate.SigningKeyCreate instance GHC.Show.Show Cachix.Types.SigningKeyCreate.SigningKeyCreate module Cachix.API api :: Proxy API data BinaryCacheAPI route BinaryCacheAPI :: (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nix-cache-info" :> Get '[XNixCacheInfo, JSON] NixCacheInfo))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> Get '[XNixNarInfo, JSON] CachixNarInfo))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> Head))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nar" :> (Capture "nar" NarFileName :> StreamGet NoFraming XNixNar (ConduitT () ByteStringStreaming (ResourceT IO) ()))))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> Get '[JSON] BinaryCache)))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("narinfo" :> (Summary "Given a list of store hashes, return a list of those that are missing" :> (ReqBody '[JSON] [Text] :> Post '[JSON] [Text]))))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("narurl" :> (Capture "nar" NarFileName :> Get '[JSON] Text)))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> (ReqBody '[JSON] NarInfoCreate :> Post '[JSON] NoContent)))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nar" :> (StreamBody NoFraming XNixNar (ConduitT () ByteStringStreaming (ResourceT IO) ()) :> Post '[JSON] NoContent)))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("serve" :> (Capture "storehash" Text :> (CaptureAll "filepath" Text :> (Summary "Serve a file from a given store path" :> Get '[XNixNar] (Headers '[Header "X-Content-Type-Options" Text] LazyByteStringStreaming))))))))) -> (route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("key" :> (ReqBody '[JSON] SigningKeyCreate :> Post '[JSON] NoContent)))))) -> BinaryCacheAPI route [nixCacheInfo] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nix-cache-info" :> Get '[XNixCacheInfo, JSON] NixCacheInfo)))) [narinfo] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> Get '[XNixNarInfo, JSON] CachixNarInfo)))) [narinfoHead] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> Head)))) [nar] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nar" :> (Capture "nar" NarFileName :> StreamGet NoFraming XNixNar (ConduitT () ByteStringStreaming (ResourceT IO) ())))))) [getCache] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> Get '[JSON] BinaryCache))) [narinfoBulk] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("narinfo" :> (Summary "Given a list of store hashes, return a list of those that are missing" :> (ReqBody '[JSON] [Text] :> Post '[JSON] [Text])))))) [narURL] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("narurl" :> (Capture "nar" NarFileName :> Get '[JSON] Text))))) [createNarinfo] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> (Capture "narinfohash" NarInfoHash :> (ReqBody '[JSON] NarInfoCreate :> Post '[JSON] NoContent))))) [createNar] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("nar" :> (StreamBody NoFraming XNixNar (ConduitT () ByteStringStreaming (ResourceT IO) ()) :> Post '[JSON] NoContent))))) [serveNarContent] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("serve" :> (Capture "storehash" Text :> (CaptureAll "filepath" Text :> (Summary "Serve a file from a given store path" :> Get '[XNixNar] (Headers '[Header "X-Content-Type-Options" Text] LazyByteStringStreaming)))))))) [createKey] :: BinaryCacheAPI route -> route :- (CachixAuth :> ("cache" :> (Capture "name" Text :> ("key" :> (ReqBody '[JSON] SigningKeyCreate :> Post '[JSON] NoContent))))) type API = "api" :> "v1" :> ToServantApi BinaryCacheAPI type CachixAuth = Auth '[Cookie, JWT, BasicAuth] Session instance GHC.Generics.Generic (Cachix.API.BinaryCacheAPI route)