repo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRepo

func IsRepo(path string) bool

IsRepo returns true of the provided path is the base directory of a Git repository as determined by the presence of an objects directory and a HEAD file.

Types

type ByLastModified

type ByLastModified []*Repo

func (ByLastModified) Len

func (b ByLastModified) Len() int

func (ByLastModified) Less

func (b ByLastModified) Less(i, j int) bool

func (ByLastModified) Swap

func (b ByLastModified) Swap(i, j int)

type Repo

type Repo struct {
	// Path is the repository path relative to RepoBathPath.
	Path string
	// Slug is the URL path to the repository, relative to the
	// DGit root URL.
	Slug string
	// Owner is the repository owner as read from the gitweb.owner
	// Git config key.
	Owner string
	// Description is the repository description as read from the
	// gitweb.description Git config key.
	Description string
	// LastModified records the timestamp of the most recent
	// commit as read from info/web/last-modified within the
	// repository's Git directory. See [CGit] for prior art.
	// [CGit]: https://git.zx2c4.com/cgit/tree/contrib/hooks/post-receive.agefile
	LastModified time.Time

	// R is the raw repository
	R *git.Repository
}

A repo contains information for a single repository.

func NewRepo

func NewRepo(path string, cfg config.Config) (*Repo, error)

Jump to

Keyboard shortcuts

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