hit-0.6.3: Git operations in haskell

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unix
Safe Haskell | None
Language | Haskell98

Data.Git.Storage.Loose

Contents

- marshall from and to lazy bytestring
- read and check object existence
- write objects
- enumeration of loose objects

Description

Synopsis

- newtype Zipped = Zipped {
  - getZippedData :: ByteString
  }
- looseUnmarshall :: ByteString -> Object
- looseUnmarshallRaw :: ByteString -> (ObjectHeader, ObjectData)
- looseUnmarshallZipped :: Zipped -> Object
- looseUnmarshallZippedRaw :: Zipped -> (ObjectHeader, ObjectData)
- looseMarshall :: Object -> ByteString
- looseRead :: FilePath -> Ref -> IO Object
- looseReadHeader :: FilePath -> Ref -> IO (ObjectType, Word64, Maybe a)
- looseReadRaw :: FilePath -> Ref -> IO (ObjectHeader, ObjectData)
- looseExists :: FilePath -> Ref -> IO Bool
- looseWriteBlobFromFile :: FilePath -> FilePath -> IO Ref
- looseWrite :: FilePath -> Object -> IO Ref
- looseEnumeratePrefixes :: FilePath -> IO [[Char]]
- looseEnumerateWithPrefixFilter :: FilePath -> String -> (Ref -> Bool) -> IO [Ref]
- looseEnumerateWithPrefix :: FilePath -> String -> IO [Ref]

# Documentation

newtype Zipped Source #

Constructors

Zipped |

Fields

- getZippedData :: ByteString

Instances

Eq Zipped Source # |
Methods (==) :: Zipped -> Zipped -> Bool # (/=) :: Zipped -> Zipped -> Bool #
Show Zipped Source # |
Methods showsPrec :: Int -> Zipped -> ShowS # show :: Zipped -> String # showList :: [Zipped] -> ShowS #

# marshall from and to lazy bytestring

looseUnmarshall :: ByteString -> Object Source #

unmarshall an object (with header) from a bytestring.

looseUnmarshallRaw :: ByteString -> (ObjectHeader, ObjectData) Source #

unmarshall an object as (header, data) tuple from a bytestring

looseUnmarshallZipped :: Zipped -> Object Source #

unmarshall an object (with header) from a zipped stream.

looseUnmarshallZippedRaw :: Zipped -> (ObjectHeader, ObjectData) Source #

unmarshall an object as (header, data) tuple from a zipped stream

looseMarshall :: Object -> ByteString Source #

marshall as lazy bytestring an object except deltas.

# read and check object existence

looseRead :: FilePath -> Ref -> IO Object Source #

read a specific ref from a loose object and returns an object

looseReadHeader :: FilePath -> Ref -> IO (ObjectType, Word64, Maybe a) Source #

read only the header of a loose object.

looseReadRaw :: FilePath -> Ref -> IO (ObjectHeader, ObjectData) Source #

read a specific ref from a loose object and returns an header and data.

looseExists :: FilePath -> Ref -> IO Bool Source #

check if a specific ref exists as loose object

# write objects

looseWriteBlobFromFile :: FilePath -> FilePath -> IO Ref Source #

create a new blob on a temporary location and on success move it to the object store with its digest name.

looseWrite :: FilePath -> Object -> IO Ref Source #

write an object to disk as a loose reference. use looseWriteBlobFromFile for efficiently writing blobs when being commited from a file.

# enumeration of loose objects

looseEnumeratePrefixes :: FilePath -> IO [[Char]] Source #

enumarate all prefixes available in the object store.

looseEnumerateWithPrefixFilter :: FilePath -> String -> (Ref -> Bool) -> IO [Ref] Source #

enumerate all references available with a specific prefix.

looseEnumerateWithPrefix :: FilePath -> String -> IO [Ref] Source #