summaryrefslogtreecommitdiffhomepage
path: root/Storage.hs
blob: 6b23c3340e3985138975ceb267f30063a6ba97c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{- Copyright 2016 Joey Hess <id@joeyh.name>
 -
 - Licensed under the GNU AGPL version 3 or higher.
 -}

module Storage where

import Types

data Storage = Storage
	{ storeShard :: StorableObjectIdent -> Shard -> IO StoreResult
	, retrieveShard :: ShardNum -> StorableObjectIdent -> IO RetrieveResult
	}

data StoreResult = StoreSuccess | StoreFailure String
	deriving (Show)

data RetrieveResult = RetrieveSuccess Shard | RetrieveFailure String