Documentation ¶
Index ¶
- Variables
- func AutoselectDefaultBranch(repo *git.Repository) error
- func GetDefaultBranch(repo *git.Repository) (plumbing.ReferenceName, error)
- func GetHEAD(repo *git.Repository) (*plumbing.Reference, error)
- func GetReadmeContent(repo *git.Repository) ([]byte, error)
- func GetRenderedReadmeContent(repo *git.Repository) (string, error)
- func IsRepositoryEmpty(repo *git.Repository) (bool, error)
- func SetDefaultBranch(repo *git.Repository, ref plumbing.ReferenceName) error
- func ValidateRepositoryName(repoNameSlug string) error
- func ValidateSlug(input string) bool
- type RepoOnDisk
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoReadme = errors.New("no README.md file found")
Functions ¶
func AutoselectDefaultBranch ¶
func AutoselectDefaultBranch(repo *git.Repository) error
func GetDefaultBranch ¶
func GetDefaultBranch(repo *git.Repository) (plumbing.ReferenceName, error)
func GetReadmeContent ¶
GetReadmeContent returns the raw Markdown of a README.md file
func IsRepositoryEmpty ¶
func SetDefaultBranch ¶
func SetDefaultBranch(repo *git.Repository, ref plumbing.ReferenceName) error
func ValidateRepositoryName ¶
func ValidateSlug ¶
Types ¶
type RepoOnDisk ¶
func CreateRepository ¶
func CreateRepository(name string) (*RepoOnDisk, error)
func GetRepository ¶
func GetRepository(slug string) (*RepoOnDisk, error)
func ListRepositories ¶
func ListRepositories() ([]*RepoOnDisk, error)
ListRepositories returns the list of repositories in a given directory.
It assumes that any directory is a repository.
func (*RepoOnDisk) Size ¶
func (r *RepoOnDisk) Size() (int64, error)
Click to show internal directories.
Click to hide internal directories.