Documentation ¶
Index ¶
- func ApplyObjectDelta(r LocalRepository, delta GitObjectDelta) error
- func CreateSha1Hex(content []byte) (string, error)
- func FindNull(s string) int
- func Map[T any](slice []T, fn func(T) T) []T
- func ParsePackFile(packFile []byte) ([]GitObject, []GitObjectDelta, error)
- type GitObject
- type GitObjectDelta
- type GitReference
- type LocalRepository
- func (r *LocalRepository) CatFile(hashHex string) (string, error)
- func (r *LocalRepository) GitDir() string
- func (r *LocalRepository) HeadName() string
- func (r *LocalRepository) Init() error
- func (r *LocalRepository) ObjectExists(hashHex string) bool
- func (r *LocalRepository) ObjectsName() string
- func (r *LocalRepository) ReadObject(hashHex string) (string, error)
- func (r *LocalRepository) ReadTreeObject(hashHex string, nameonly bool) ([]string, error)
- func (r *LocalRepository) RefsName() string
- func (r *LocalRepository) WriteBlobObject(filename string) ([]byte, string, error)
- func (r *LocalRepository) WriteCommitObject(treeSha string, parentSha string, message string) (string, error)
- func (r *LocalRepository) WriteObject(hashHex string, content []byte) error
- func (r *LocalRepository) WriteObjectWithType(objType string, content []byte) error
- func (r *LocalRepository) WriteTreeObject(dirname string) ([]byte, string, error)
- type PackFileObjectType
- type PackfileObjectHeader
- type RemoteRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyObjectDelta ¶
func ApplyObjectDelta(r LocalRepository, delta GitObjectDelta) error
func CreateSha1Hex ¶
func ParsePackFile ¶
func ParsePackFile(packFile []byte) ([]GitObject, []GitObjectDelta, error)
https://git-scm.com/docs/pack-format https://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/#implementing-pack-file-negotiation https://bitbucket.org/ssaasen/git/src/master/Documentation/technical/pack-format.txt
Types ¶
type GitObjectDelta ¶
type GitReference ¶
type LocalRepository ¶
type LocalRepository struct {
RootName string
}
func (*LocalRepository) GitDir ¶
func (r *LocalRepository) GitDir() string
func (*LocalRepository) HeadName ¶
func (r *LocalRepository) HeadName() string
func (*LocalRepository) Init ¶
func (r *LocalRepository) Init() error
func (*LocalRepository) ObjectExists ¶
func (r *LocalRepository) ObjectExists(hashHex string) bool
func (*LocalRepository) ObjectsName ¶
func (r *LocalRepository) ObjectsName() string
func (*LocalRepository) ReadObject ¶
func (r *LocalRepository) ReadObject(hashHex string) (string, error)
func (*LocalRepository) ReadTreeObject ¶
func (r *LocalRepository) ReadTreeObject(hashHex string, nameonly bool) ([]string, error)
func (*LocalRepository) RefsName ¶
func (r *LocalRepository) RefsName() string
func (*LocalRepository) WriteBlobObject ¶
func (r *LocalRepository) WriteBlobObject(filename string) ([]byte, string, error)
func (*LocalRepository) WriteCommitObject ¶
func (*LocalRepository) WriteObject ¶
func (r *LocalRepository) WriteObject(hashHex string, content []byte) error
func (*LocalRepository) WriteObjectWithType ¶
func (r *LocalRepository) WriteObjectWithType(objType string, content []byte) error
func (*LocalRepository) WriteTreeObject ¶
func (r *LocalRepository) WriteTreeObject(dirname string) ([]byte, string, error)
type PackFileObjectType ¶
type PackFileObjectType int
const ( OBJ_COMMIT PackFileObjectType = 1 OBJ_TREE PackFileObjectType = 2 OBJ_BLOB PackFileObjectType = 3 OBJ_TAG PackFileObjectType = 4 OBJ_OFS_DELTA PackFileObjectType = 6 OBJ_REF_DELTA PackFileObjectType = 7 )
type PackfileObjectHeader ¶
type PackfileObjectHeader struct { ObjectType PackFileObjectType HeaderSize int ContentSize int64 }
type RemoteRepository ¶
type RemoteRepository struct { BaseUrl string // contains filtered or unexported fields }
func NewRemoteRepository ¶
func NewRemoteRepository(BaseUrl string) (RemoteRepository, error)
func (*RemoteRepository) DiscoveringReferences ¶
func (r *RemoteRepository) DiscoveringReferences() ([]GitReference, error)
https://git-scm.com/docs/gitprotocol-http/en#_discovering_references
func (*RemoteRepository) UploadPack ¶
func (r *RemoteRepository) UploadPack(wants []string) ([]GitObject, []GitObjectDelta, error)
https://git-scm.com/docs/gitprotocol-http/en#_smart_service_git_upload_pack https://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/#implementing-ref-discovery
Click to show internal directories.
Click to hide internal directories.