gitobjects

package module
v0.0.0-...-e7b24fc Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2017 License: MIT Imports: 13 Imported by: 0

README

gitobjects

Golang package for dealing with low-level aspects of Git

This is a work-in-progress

NewRepo(directory)

Call this to get a new Repo object pointer. Pass in the workspace or .git directory path.

StreamObjectsOfType(objectType)

This returns two channels which return object structs that are of one type, either commit, blob, tree, or annotated-tag.

Types

Commit

Tree

StreamBlobPathsUnique

Blob

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTreeCache

func NewTreeCache() *treeCacheConcurrentSafe

Types

type Blob

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

func (*Blob) DecompressedSizeBytes

func (self *Blob) DecompressedSizeBytes(repo *Repo) (int, error)

func (*Blob) Instantiate

func (self *Blob) Instantiate(repo *Repo) error

func (*Blob) Sha1

func (self *Blob) Sha1() string

func (*Blob) Type

func (self *Blob) Type() string

type BlobPath

type BlobPath struct {
	Blob *Blob
	Path string
}

type Commit

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

func (*Commit) Instantiate

func (self *Commit) Instantiate(repo *Repo) error

func (*Commit) InstantiateTree

func (self *Commit) InstantiateTree(repo *Repo) (*Tree, error)

func (*Commit) Message

func (self *Commit) Message() string

func (*Commit) Sha1

func (self *Commit) Sha1() string

func (*Commit) Tree

func (self *Commit) Tree() *Tree

func (*Commit) Type

func (self *Commit) Type() string

type Entry

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

func (*Entry) Name

func (self *Entry) Name() string

func (*Entry) Sha1

func (self *Entry) Sha1() string

func (*Entry) Tree

func (self *Entry) Tree() *Tree

func (*Entry) Type

func (self *Entry) Type() string

type Object

type Object interface {
	// Returns the type of Object
	Type() string

	// Returns the sha1 of the object
	Sha1() string

	// Do any activities that require reading from disk
	// to populate internal information about the object
	Instantiate(repo *Repo) error
}

type Repo

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

func NewRepo

func NewRepo(directory string) (*Repo, error)

func (*Repo) CmdCombinedOutput

func (self *Repo) CmdCombinedOutput(cmdv []string) ([]byte, error)

func (*Repo) CmdOutput

func (self *Repo) CmdOutput(cmdv []string) ([]byte, error)

func (*Repo) Command

func (self *Repo) Command(cmdv []string) *exec.Cmd

func (*Repo) GitDir

func (self *Repo) GitDir() string

func (*Repo) Run

func (self *Repo) Run(cmdv []string) error

func (*Repo) StreamObjectsOfType

func (self *Repo) StreamObjectsOfType(ctx context.Context, objectType string, jFactor int) (<-chan Object, <-chan error)

Stream all Objects of a certain type on the Object channel. Once done reading the Object Channel, read the error channel to see if the stream stopped due to any error. The context can be used to cancel the request in progress.

type Tree

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

func (*Tree) Instantiate

func (self *Tree) Instantiate(repo *Repo) error

func (*Tree) Sha1

func (self *Tree) Sha1() string

func (*Tree) StreamBlobPathsUnique

func (self *Tree) StreamBlobPathsUnique(repo *Repo, sha1sSeen map[string]bool) (<-chan *BlobPath, <-chan error)

func (*Tree) Type

func (self *Tree) Type() string

Jump to

Keyboard shortcuts

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