core

package
v0.0.0-...-92b599d Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 GetHEAD

func GetHEAD(repo *git.Repository) (*plumbing.Reference, error)

func GetReadmeContent

func GetReadmeContent(repo *git.Repository) ([]byte, error)

GetReadmeContent returns the raw Markdown of a README.md file

func GetRenderedReadmeContent

func GetRenderedReadmeContent(repo *git.Repository) (string, error)

func IsRepositoryEmpty

func IsRepositoryEmpty(repo *git.Repository) (bool, error)

func SetDefaultBranch

func SetDefaultBranch(repo *git.Repository, ref plumbing.ReferenceName) error

func ValidateRepositoryName

func ValidateRepositoryName(repoNameSlug string) error

func ValidateSlug

func ValidateSlug(input string) bool

Types

type RepoOnDisk

type RepoOnDisk struct {
	Slug        string
	Description string

	Path string
}

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)

Jump to

Keyboard shortcuts

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