Data.Git.Storage.Loose

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 #

Constructors

Zipped |
Fields getZippedData :: ByteString

Instances

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

# marshall from and to lazy bytestring

looseUnmarshall :: ByteString -> Object #

unmarshall an object (with header) from a bytestring.

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

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

looseUnmarshallZipped :: Zipped -> Object #

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

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

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

looseMarshall :: Object -> ByteString #

marshall as lazy bytestring an object except deltas.

# read and check object existence

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

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

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

read only the header of a loose object.

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

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

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

check if a specific ref exists as loose object

# write objects

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

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 #

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]] #

enumarate all prefixes available in the object store.

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

enumerate all references available with a specific prefix.

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