Documentation ¶
Index ¶
- Constants
- Variables
- type Blob
- type Commit
- type CommitIter
- type File
- type Hash
- type Remote
- func (r *Remote) Capabilities() *common.Capabilities
- func (r *Remote) Connect() error
- func (r *Remote) DefaultBranch() string
- func (r *Remote) Fetch(req *common.GitUploadPackRequest) (io.ReadCloser, error)
- func (r *Remote) FetchDefaultBranch() (io.ReadCloser, error)
- func (r *Remote) Info() *common.GitUploadPackInfo
- func (r *Remote) Ref(refName string) (core.Hash, error)
- func (r *Remote) Refs() map[string]core.Hash
- type Repository
- type Signature
- type Tree
- type TreeEntry
- type TreeIter
Constants ¶
const (
DefaultRemoteName = "origin"
)
Variables ¶
var (
ObjectNotFoundErr = errors.New("object not found")
)
Functions ¶
This section is empty.
Types ¶
type Blob ¶
Blob is used to store file data - it is generally a file.
type Commit ¶
type Commit struct { Hash core.Hash Author Signature Committer Signature Message string // contains filtered or unexported fields }
Commit points to a single tree, marking it as what the project looked like at a certain point in time. It contains meta-information about that point in time, such as a timestamp, the author of the changes since the last commit, a pointer to the previous commit(s), etc. http://schacon.github.io/gitbook/1_the_git_object_model.html
func (*Commit) Parents ¶
func (c *Commit) Parents() *CommitIter
type CommitIter ¶
type CommitIter struct {
// contains filtered or unexported fields
}
func NewCommitIter ¶
func NewCommitIter(r *Repository) *CommitIter
func (*CommitIter) Next ¶
func (i *CommitIter) Next() (*Commit, error)
type Remote ¶
type Remote struct { Endpoint common.Endpoint Auth common.AuthMethod // contains filtered or unexported fields }
func NewAuthenticatedRemote ¶
func NewAuthenticatedRemote(url string, auth common.AuthMethod) (*Remote, error)
NewAuthenticatedRemote returns a new Remote using the given AuthMethod, using as client http.DefaultClient
func (*Remote) Capabilities ¶
func (r *Remote) Capabilities() *common.Capabilities
Capabilities returns the remote capabilities
func (*Remote) DefaultBranch ¶
DefaultBranch returns the name of the remote's default branch
func (*Remote) Fetch ¶
func (r *Remote) Fetch(req *common.GitUploadPackRequest) (io.ReadCloser, error)
Fetch returns a reader using the request
func (*Remote) FetchDefaultBranch ¶
func (r *Remote) FetchDefaultBranch() (io.ReadCloser, error)
FetchDefaultBranch returns a reader for the default branch
func (*Remote) Info ¶
func (r *Remote) Info() *common.GitUploadPackInfo
Info returns the git-upload-pack info
type Repository ¶
type Repository struct { Remotes map[string]*Remote Storage *core.RAWObjectStorage }
func NewPlainRepository ¶
func NewPlainRepository() *Repository
NewPlainRepository creates a new repository without remotes
func NewRepository ¶
func NewRepository(url string, auth common.AuthMethod) (*Repository, error)
NewRepository creates a new repository setting remote as default remote
func (*Repository) Commit ¶
func (r *Repository) Commit(h core.Hash) (*Commit, error)
Commit return the commit with the given hash
func (*Repository) Commits ¶
func (r *Repository) Commits() *CommitIter
Commits decode the objects into commits
func (*Repository) Pull ¶
func (r *Repository) Pull(remoteName, branch string) error
type Signature ¶
Signature represents an action signed by a person
type Tree ¶
Tree is basically like a directory - it references a bunch of other trees and/or blobs (i.e. files and sub-directories)
type TreeIter ¶
type TreeIter struct {
// contains filtered or unexported fields
}
func NewTreeIter ¶
func NewTreeIter(r *Repository) *TreeIter