gogit

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	GT = '>'
	LT = '<'
	SP = ' '
	NL = '\n'
)
View Source
const (
	FileModeBlob     = 0100644
	FileModeBlobExec = 0100755
	FileModeSymlink  = 0120000
	FileModeCommit   = 0160000
	FileModeTree     = 0040000
)

Variables

This section is empty.

Functions

func ReadObjectFile added in v0.0.4

func ReadObjectFile(path string) (data []byte, err error)

Types

type Blob

type Blob struct {
	// contains filtered or unexported fields
}

func (*Blob) Contents

func (b *Blob) Contents() []byte

func (*Blob) Size

func (b *Blob) Size() int

type Commit

type Commit struct {
	Tree      *Oid
	Parent    []*Oid
	Author    *Signature
	Committer *Signature
	Message   string
	Oid       *Oid
	// contains filtered or unexported fields
}

func (*Commit) ParentCommit added in v0.0.4

func (ci *Commit) ParentCommit(n int) *Commit

func (*Commit) TreeId

func (ci *Commit) TreeId() *Oid

type Index added in v0.0.4

type Index struct {
	// contains filtered or unexported fields
}

type Object

type Object struct {
	Type ObjectType
	Oid  *Oid
}

type ObjectType

type ObjectType int
const (
	ObjectCommit ObjectType = 0x10
	ObjectTree   ObjectType = 0x20
	ObjectBlob   ObjectType = 0x30
	ObjectTag    ObjectType = 0x40
)

func (ObjectType) String

func (t ObjectType) String() string

type Oid

type Oid struct{ Bytes [20]byte }

func NewOid

func NewOid(b []byte) (*Oid, error)

func (*Oid) Short added in v0.0.4

func (o *Oid) Short() string

func (*Oid) String

func (o *Oid) String() string

type Reference

type Reference struct {
	Name string

	Oid *Oid
	// contains filtered or unexported fields
}

func (*Reference) Target

func (r *Reference) Target() *Oid

type Repository

type Repository struct {
	Path string
	// contains filtered or unexported fields
}

func OpenRepository

func OpenRepository(path string) (*Repository, error)

func (*Repository) GetBranch added in v0.0.2

func (repos *Repository) GetBranch() string

func (*Repository) GetCommit added in v0.0.2

func (repos *Repository) GetCommit() (*Commit, error)

func (*Repository) GetOrigin added in v0.0.2

func (repos *Repository) GetOrigin() string

func (*Repository) LookupBlob

func (repos *Repository) LookupBlob(oid *Oid) (*Blob, error)

func (*Repository) LookupCommit

func (repos *Repository) LookupCommit(oid *Oid) (*Commit, error)

func (*Repository) LookupReference

func (repos *Repository) LookupReference(name string) (*Reference, error)

func (*Repository) LookupTag

func (repos *Repository) LookupTag(oid *Oid) (*Tag, error)

func (*Repository) LookupTree

func (repos *Repository) LookupTree(oid *Oid) (*Tree, error)

type Signature

type Signature struct {
	Email string
	Name  string
	When  time.Time
}

type Tag

type Tag struct {
	Type     TagType
	Name     string
	Message  string
	TargetId *Oid
	Tagger   *Signature
	// contains filtered or unexported fields
}

type TagType

type TagType int
const (
	TagCommit TagType = iota
)

type Tree

type Tree struct {
	Oid *Oid
	// contains filtered or unexported fields
}

func (*Tree) Walk

func (tree *Tree) Walk(callback TreeWalkCallback) error

type TreeEntry

type TreeEntry struct {
	Filemode int
	Name     string
	Type     ObjectType
	Oid      *Oid
}

type TreeWalkCallback

type TreeWalkCallback func(string, *TreeEntry) bool

Jump to

Keyboard shortcuts

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