gitdb

package module
v0.0.0-...-700ca5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 7 Imported by: 0

README

gitdb

impl backend in golang for git2go

一开始是觉得git2go里面的后端只支持c实现,想要基于go实现mysql后端。于是实现了这些代码。里面各种go-c-go-c调用,基本上把cgo中能遇到的问题都遇到了。

后来考虑使用go-git实现可能简单一些,这些代码就先留在这里了。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleList

type HandleList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewHandleList

func NewHandleList() *HandleList

func (*HandleList) Get

func (l *HandleList) Get(handle unsafe.Pointer) interface{}

func (*HandleList) Track

func (l *HandleList) Track(handle unsafe.Pointer, value interface{})

func (*HandleList) Untrack

func (l *HandleList) Untrack(handle unsafe.Pointer) interface{}

type OdbBackend

type OdbBackend struct {
	Read       func(oid *git.Oid) ([]byte, git.ObjectType, error)
	ReadHeader func(oid *git.Oid) (uint64, git.ObjectType, error)
	Exists     func(oid *git.Oid) bool
	ForEach    func(callback git.OdbForEachCallback) error
	Write      func(oid *git.Oid, data []byte, otype git.ObjectType) error
	Free       func()
}

func NewOdbBackend

func NewOdbBackend() *OdbBackend

func (*OdbBackend) Track

func (v *OdbBackend) Track() *git.OdbBackend

type RefdbBackend

type RefdbBackend struct {
	Exists   func(ref_name string) bool
	Lookup   func(ref_name string) (git.ReferenceType, string, error)
	Iterator func(glob string) (ReferenceIterator, error)
	Write    func(ref Reference, force bool, who *git.Signature, message string, old_id *git.Oid, old_target string) error
	Rename   func(old_name string, new_name string, force bool, who *git.Signature, message string) (git.ReferenceType, string, error)
	Del      func(ref_name string, old_id *git.Oid, old_target string) error
	Free     func()
}

func NewRefdbBackend

func NewRefdbBackend() *RefdbBackend

func (*RefdbBackend) Track

func (v *RefdbBackend) Track() *git.RefdbBackend

type Reference

type Reference interface {
	Name() string
	Type() git.ReferenceType
	Target() *git.Oid
	SymbolicTarget() string
}

type ReferenceIterator

type ReferenceIterator interface {
	Next() (string, git.ReferenceType, string, error)
	Free()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL