]> ruin.nu Git - yawbih.git/commitdiff
just a basic skeleton
authorMichael Andreen <harv@ruin.nu>
Sun, 5 Dec 2004 15:26:35 +0000 (15:26 +0000)
committerMichael Andreen <harv@ruin.nu>
Sun, 5 Dec 2004 15:26:35 +0000 (15:26 +0000)
Wiki.hs

diff --git a/Wiki.hs b/Wiki.hs
index c4b7166f377a508ac021b55fcedfb1e024733269..c41effa9d481e63e5c7b41aa1aa5569504475287 100644 (file)
--- a/Wiki.hs
+++ b/Wiki.hs
@@ -1,20 +1,40 @@
 module Wiki (
+       WB
+       ,PGB
 
 ) where
 
-class WikiBackend a where
-       --Keyword -> Full text
-       getCurrent :: a -> String -> IO String
+import Dbconnect
+
+class WB a where
+       --Keyword -> (Full text,date)
+       getCurrent :: a -> String -> IO (String,String)
 
        --Keyword -> [(id,date)]
-       getList :: a -> String -> IO [(Int, String)]
+       getList :: a -> String -> IO [(String, String)]
 
        --Keyword -> id -> Full text
-       get :: a -> String -> Int -> IO String
+       get :: a -> String -> String -> IO String
 
        --Keyword -> id -> ()
-       setCurrent :: a -> String -> Int -> IO ()
+       setCurrent :: a -> String -> String -> IO ()
 
        --Keyword -> Full text -> id
-       addNew :: String -> String -> IO Int
+       addNew :: a -> String -> String -> IO String
+
+data PGB = PGB DBService
+
+createPGP host database user password = let db = createDBService host database "" user password Nothing in return (PGB db)
+
+
+instance WB PGB where
+
+       getCurrent (PGB db) key = return ("","")
+
+       getList (PGB db) key = return [("","")]
+
+       get (PGB db) key id = return ""
+
+       setCurrent (PGB db) key id = return ()
 
+       addNew (PGB db) key text = return ""