doc: add missing doc strings

This commit is contained in:
Krishnan Parthasarathi 2017-01-23 18:09:14 +05:30 committed by Aditya Manthramurthy
parent 41d86e86ff
commit a36b8b036f
3 changed files with 12 additions and 4 deletions

View File

@ -9,7 +9,8 @@ module Network.Minio
-- * Error handling
-----------------------
-- | Test
-- | Data types representing various errors that may occur while working
-- with an object storage service.
, MinioErr(..)
, MErrV(..)

View File

@ -65,6 +65,8 @@ instance Ord PartInfo where
(PartInfo a _) `compare` (PartInfo b _) = a `compare` b
-- | Represents result from a listing of incomplete uploads to a
-- bucket.
data ListUploadsResult = ListUploadsResult {
lurHasMore :: Bool
, lurNextKey :: Maybe Text
@ -73,12 +75,14 @@ data ListUploadsResult = ListUploadsResult {
, lurCPrefixes :: [Text]
} deriving (Show, Eq)
-- | Represents information about a multipart upload.
data UploadInfo = UploadInfo {
uiKey :: Object
, uiUploadId :: UploadId
, uiInitTime :: UTCTime
} deriving (Show, Eq)
-- | Represents result from a listing of objects in a bucket.
data ListObjectsResult = ListObjectsResult {
lorHasMore :: Bool
, lorNextToken :: Maybe Text
@ -86,6 +90,7 @@ data ListObjectsResult = ListObjectsResult {
, lorCPrefixes :: [Text]
} deriving (Show, Eq)
-- | Represents information about an object.
data ObjectInfo = ObjectInfo {
oiObject :: Object
, oiModTime :: UTCTime
@ -93,6 +98,8 @@ data ObjectInfo = ObjectInfo {
, oiSize :: Int64
} deriving (Show, Eq)
-- | Represents different kinds of payload that are used with S3 API
-- requests.
data Payload = PayloadBS ByteString
| PayloadH Handle
Int64 -- offset
@ -167,13 +174,13 @@ data MinioConn = MinioConn {
}
-- | Takes connection information and returns a connection object to
-- be passed to @runMinio
-- be passed to 'runMinio'
connect :: ConnectInfo -> IO MinioConn
connect ci = do
mgr <- NC.newManager defaultManagerSettings
return $ MinioConn ci mgr
-- | Run the Minio action and return the result or error.
-- | Run the Minio action and return the result or an error.
runMinio :: ConnectInfo -> Minio a -> ResourceT IO (Either MinioErr a)
runMinio ci m = do
conn <- liftIO $ connect ci

View File

@ -154,7 +154,7 @@ newMultipartUpload bucket object headers = do
}
parseNewMultipartUpload $ NC.responseBody resp
-- | PUT a part of an object as part of a multi-part upload.
-- | PUT a part of an object as part of a multipart upload.
putObjectPart :: Bucket -> Object -> UploadId -> PartNumber -> [HT.Header]
-> Handle -> Int64 -> Int64 -> Minio PartInfo
putObjectPart bucket object uploadId partNumber headers h offset size = do