You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/06/21 06:19:50 UTC

[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2504: feat(bindings/haskell): support stat

Xuanwo commented on code in PR #2504:
URL: https://github.com/apache/incubator-opendal/pull/2504#discussion_r1236432821


##########
bindings/haskell/haskell-src/OpenDAL.hs:
##########
@@ -63,6 +67,28 @@ data ErrorCode
 data OpenDALError = OpenDALError {errorCode :: ErrorCode, message :: String}
   deriving (Eq, Show)
 
+data EntryMode = File | Dir | Unknown deriving (Eq, Show)
+
+data BytesContentRange = BytesContentRange
+  { bcrStart :: Integer
+  , bcrEnd :: Integer
+  , bcrTotal :: Integer
+  }
+  deriving (Eq, Show)
+
+data Metadata = Metadata
+  { mMode :: EntryMode
+  , mCacheControl :: Maybe String
+  , mContentDisposition :: Maybe String
+  , mContentLength :: Integer
+  , mContentMD5 :: Maybe String
+  , mContentRange :: Maybe BytesContentRange
+  , mContentType :: Maybe String
+  , mETag :: Maybe String
+  , mLastModified :: Maybe POSIXTime

Review Comment:
   Does `POSIXTime` here contains time zone?



##########
bindings/haskell/haskell-src/OpenDAL.hs:
##########
@@ -63,6 +67,28 @@ data ErrorCode
 data OpenDALError = OpenDALError {errorCode :: ErrorCode, message :: String}
   deriving (Eq, Show)
 
+data EntryMode = File | Dir | Unknown deriving (Eq, Show)
+
+data BytesContentRange = BytesContentRange
+  { bcrStart :: Integer
+  , bcrEnd :: Integer
+  , bcrTotal :: Integer
+  }
+  deriving (Eq, Show)
+
+data Metadata = Metadata
+  { mMode :: EntryMode
+  , mCacheControl :: Maybe String
+  , mContentDisposition :: Maybe String
+  , mContentLength :: Integer
+  , mContentMD5 :: Maybe String
+  , mContentRange :: Maybe BytesContentRange

Review Comment:
   `BytesContentRange` should not be exposed AS-IS. It's not part of OpenDAL's public API. Please use string.



##########
bindings/haskell/haskell-src/OpenDAL.hs:
##########
@@ -63,6 +67,28 @@ data ErrorCode
 data OpenDALError = OpenDALError {errorCode :: ErrorCode, message :: String}
   deriving (Eq, Show)
 
+data EntryMode = File | Dir | Unknown deriving (Eq, Show)
+
+data BytesContentRange = BytesContentRange
+  { bcrStart :: Integer
+  , bcrEnd :: Integer
+  , bcrTotal :: Integer
+  }
+  deriving (Eq, Show)
+
+data Metadata = Metadata
+  { mMode :: EntryMode
+  , mCacheControl :: Maybe String
+  , mContentDisposition :: Maybe String
+  , mContentLength :: Integer
+  , mContentMD5 :: Maybe String
+  , mContentRange :: Maybe BytesContentRange

Review Comment:
   Maybe it's better just to ignore it (for now).



##########
bindings/haskell/haskell-src/OpenDAL.hs:
##########
@@ -63,6 +67,28 @@ data ErrorCode
 data OpenDALError = OpenDALError {errorCode :: ErrorCode, message :: String}
   deriving (Eq, Show)
 
+data EntryMode = File | Dir | Unknown deriving (Eq, Show)
+
+data BytesContentRange = BytesContentRange
+  { bcrStart :: Integer
+  , bcrEnd :: Integer
+  , bcrTotal :: Integer
+  }
+  deriving (Eq, Show)
+
+data Metadata = Metadata
+  { mMode :: EntryMode
+  , mCacheControl :: Maybe String
+  , mContentDisposition :: Maybe String
+  , mContentLength :: Integer

Review Comment:
   Does `Integer` here contains u64?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org