Skip to content

Instantly share code, notes, and snippets.

@joshcough
Last active November 2, 2018 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshcough/2c0cc66fc63f856f70d71928d5834961 to your computer and use it in GitHub Desktop.
Save joshcough/2c0cc66fc63f856f70d71928d5834961 to your computer and use it in GitHub Desktop.
class Monad m => FilesDb m where
insertFile :: DbTeamId -> DbFolderId -> Text -> m (Entity DbFile)
insertFolder :: DbTeamId -> DbFolderId -> Text -> m (Key DbFolder)
getRootFolder :: DbTeamId -> m (Maybe (Folder (Entity DbFile)))
getFile :: DbFileId -> m (Maybe (Entity DbFile))
-- | Purposely doesn't fetch the children, because we don't want to use recursion right now.
getFolder :: DbFolderId -> m (Maybe (Folder (Entity DbFile)))
getFolderRecursive :: DbFolderId -> m (Maybe (Folder (Entity DbFile)))
deleteFile :: DbFileId -> m ()
deleteFolder :: DbFolderId -> m ()
moveFile :: DbFileId -> Folder a -> m ()
moveFolder :: Folder a -> Folder a -> m ()
class Monad m => S3FileServer m where
uploadFile :: UploadFile -> m File
deleteFile :: Entity DbFile -> m File
deleteFolder :: Folder (Entity DbFile) -> m [File]
withS3Paths :: Entity DbFile -> m File
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment