git

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingRepo = errors.New("missing repo")

ErrMissingRepo indicates that the requested repository could not be found.

Functions

This section is empty.

Types

type CommitLog

type CommitLog []RepoCommit

CommitLog is a series of Git commits.

func (CommitLog) Len

func (cl CommitLog) Len() int

func (CommitLog) Less

func (cl CommitLog) Less(i, j int) bool

func (CommitLog) Swap

func (cl CommitLog) Swap(i, j int)

type Repo

type Repo struct {
	Name        string
	Repository  *git.Repository
	Readme      string
	LastUpdated *time.Time
	// contains filtered or unexported fields
}

Repo represents a Git repository.

func (*Repo) GetCommits added in v0.2.0

func (r *Repo) GetCommits(limit int) CommitLog

func (*Repo) LatestFile

func (r *Repo) LatestFile(path string) (string, error)

LatestFile returns the latest file at the specified path in the repository.

type RepoCommit

type RepoCommit struct {
	Name   string
	Commit *object.Commit
}

RepoCommit contains metadata for a Git commit.

type RepoSource

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

RepoSource is a reference to an on-disk repositories.

func NewRepoSource

func NewRepoSource(repoPath string) *RepoSource

NewRepoSource creates a new RepoSource.

func (*RepoSource) AllRepos

func (rs *RepoSource) AllRepos() []*Repo

AllRepos returns all repositories for the given RepoSource.

func (*RepoSource) GetRepo

func (rs *RepoSource) GetRepo(name string) (*Repo, error)

GetRepo returns a repository by name.

func (*RepoSource) InitRepo

func (rs *RepoSource) InitRepo(name string, bare bool) (*Repo, error)

InitRepo initializes a new Git repository.

func (*RepoSource) LoadRepos

func (rs *RepoSource) LoadRepos() error

LoadRepos opens Git repositories.

Jump to

Keyboard shortcuts

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