| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | unix |
| Safe Haskell | None |
| Language | Haskell98 |
Data.Git.Storage.Object
Contents
Description
- data ObjectLocation hash
- data ObjectType
- type ObjectHeader hash = (ObjectType, Word64, Maybe (ObjectPtr hash))
- type ObjectData = ByteString
- data ObjectPtr hash
- data Object hash
- data ObjectInfo hash = ObjectInfo {
- oiHeader :: ObjectHeader hash
- oiData :: ObjectData
- oiChains :: [ObjectPtr hash]
- class Objectable a where
- objectToType :: Object hash -> ObjectType
- objectTypeMarshall :: ObjectType -> String
- objectTypeUnmarshall :: ByteString -> ObjectType
- objectTypeIsDelta :: ObjectType -> Bool
- objectIsDelta :: Object hash -> Bool
- objectToTree :: Object hash -> Maybe (Tree hash)
- objectToCommit :: Object hash -> Maybe (Commit hash)
- objectToTag :: Object hash -> Maybe (Tag hash)
- objectToBlob :: Object hash -> Maybe (Blob hash)
- treeParse :: HashAlgorithm hash => Parser (Tree hash)
- commitParse :: HashAlgorithm hash => Parser (Commit hash)
- tagParse :: HashAlgorithm hash => Parser (Tag hash)
- blobParse :: Parser (Blob hash)
- objectParseTree :: HashAlgorithm hash => Parser (Object hash)
- objectParseCommit :: HashAlgorithm hash => Parser (Object hash)
- objectParseTag :: HashAlgorithm hash => Parser (Object hash)
- objectParseBlob :: HashAlgorithm hash => Parser (Object hash)
- objectWriteHeader :: ObjectType -> Word64 -> ByteString
- objectWrite :: Object hash -> ByteString
- objectHash :: HashAlgorithm hash => ObjectType -> Word64 -> ByteString -> Ref hash
Documentation
data ObjectLocation hash #
location of an object in the database
Instances
| Eq (ObjectLocation hash) # | |
| Show (ObjectLocation hash) # | |
data ObjectType #
type of a git object.
Constructors
| TypeTree | |
| TypeBlob | |
| TypeCommit | |
| TypeTag | |
| TypeDeltaOff | |
| TypeDeltaRef |
Instances
| Enum ObjectType # | the enum instance is useful when marshalling to pack file. |
| Eq ObjectType # | |
| Data ObjectType # | |
| Show ObjectType # | |
type ObjectHeader hash = (ObjectType, Word64, Maybe (ObjectPtr hash)) #
type ObjectData = ByteString #
Delta objects points to some others objects in the database either as offset in the pack or as a direct reference.
describe a git object, that could of 6 differents types: tree, blob, commit, tag and deltas (offset or ref). the deltas one are only available in packs.
data ObjectInfo hash #
Raw objects infos have an header (type, size, ptr), the data and a pointers chains to parents for resolved objects.
Constructors
| ObjectInfo | |
Fields
| |
Instances
| Eq (ObjectInfo hash) # | |
| Show (ObjectInfo hash) # | |
class Objectable a where #
Instances
objectToType :: Object hash -> ObjectType #
objectTypeMarshall :: ObjectType -> String #
objectTypeIsDelta :: ObjectType -> Bool #
objectIsDelta :: Object hash -> Bool #
objectToTree :: Object hash -> Maybe (Tree hash) #
objectToCommit :: Object hash -> Maybe (Commit hash) #
objectToTag :: Object hash -> Maybe (Tag hash) #
objectToBlob :: Object hash -> Maybe (Blob hash) #
parsing function
treeParse :: HashAlgorithm hash => Parser (Tree hash) #
parse a tree content
commitParse :: HashAlgorithm hash => Parser (Commit hash) #
parse a commit content
tagParse :: HashAlgorithm hash => Parser (Tag hash) #
parse a tag content
objectParseTree :: HashAlgorithm hash => Parser (Object hash) #
objectParseCommit :: HashAlgorithm hash => Parser (Object hash) #
objectParseTag :: HashAlgorithm hash => Parser (Object hash) #
objectParseBlob :: HashAlgorithm hash => Parser (Object hash) #
writing function
objectWriteHeader :: ObjectType -> Word64 -> ByteString #
objectWrite :: Object hash -> ByteString #
objectHash :: HashAlgorithm hash => ObjectType -> Word64 -> ByteString -> Ref hash #