Documentation ¶
Index ¶
- Variables
- type Repo
- func (r *Repo) CommitsByPage(ref *git.Reference, page, size int) (git.Commits, error)
- func (r *Repo) CountCommits(ref *git.Reference) (int64, error)
- func (r *Repo) Diff(commit *git.Commit) (*git.Diff, error)
- func (r *Repo) HEAD() (*git.Reference, error)
- func (r *Repo) LatestFile(pattern string) (string, string, error)
- func (r *Repo) Name() string
- func (r *Repo) Path() string
- func (r *Repo) Push(remote, branch string) error
- func (r *Repo) Readme() (readme string, path string)
- func (r *Repo) References() ([]*git.Reference, error)
- func (r *Repo) SetReadme(readme, path string)
- func (r *Repo) Tree(ref *git.Reference, path string) (*git.Tree, error)
- func (r *Repo) UpdateServerInfo() error
- type RepoSource
Constants ¶
This section is empty.
Variables ¶
var ErrMissingRepo = errors.New("missing repo")
ErrMissingRepo indicates that the requested repository could not be found.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo represents a Git repository.
func (*Repo) CommitsByPage ¶ added in v0.3.0
CommitsByPage returns the commits for a repository.
func (*Repo) CountCommits ¶ added in v0.3.0
CountCommits returns the number of commits for a repository.
func (*Repo) LatestFile ¶
LatestFile returns the contents of the latest file at the specified path in the repository and its file path.
func (*Repo) References ¶ added in v0.3.0
GetReferences returns the references for a repository.
func (*Repo) UpdateServerInfo ¶ added in v0.3.0
UpdateServerInfo updates the server info for the repository.
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) LoadRepo ¶ added in v0.3.0
func (rs *RepoSource) LoadRepo(name string) error
LoadRepo loads a repository from disk.
func (*RepoSource) LoadRepos ¶
func (rs *RepoSource) LoadRepos() error
LoadRepos opens Git repositories.