gitweb

package
v0.0.0-...-aa06cb2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExpectedDirectory = errors.New("Expected directory")
	ExpectedSubmodule = errors.New("Expected submodule")
	ExpectedRegular   = errors.New("Expected regular file")
)

Functions

This section is empty.

Types

type CommitInfo

type CommitInfo struct {
	Commits []*object.Commit
	Total   uint
}

type Repo

type Repo struct {
	Path  string
	Title string
	URL   string
	// contains filtered or unexported fields
}

func NewRepo

func NewRepo(fp string, cloneURL *url.URL, commits uint) (*Repo, error)

func (*Repo) Description

func (r *Repo) Description() (string, error)

func (*Repo) ReadState

func (r *Repo) ReadState(fp string) error

func (*Repo) Tip

func (r *Repo) Tip() (*object.Commit, error)

func (*Repo) Walk

func (r *Repo) Walk(fn WalkFunc) error

func (*Repo) WriteState

func (r *Repo) WriteState(fp string) error

type RepoFile

type RepoFile struct {
	Path string // Slash separated path
	// contains filtered or unexported fields
}

RepoFile represents information for a single file/blob.

func (*RepoFile) FilePath

func (f *RepoFile) FilePath() string

func (*RepoFile) IsDir

func (f *RepoFile) IsDir() bool

func (*RepoFile) IsSubmodule

func (f *RepoFile) IsSubmodule() bool

func (*RepoFile) Name

func (f *RepoFile) Name() string

func (*RepoFile) PathElements

func (f *RepoFile) PathElements() []string

type RepoPage

type RepoPage struct {
	*Repo

	// Underlying file which is present on this page.
	CurrentFile RepoFile
	// contains filtered or unexported fields
}

func (*RepoPage) Blob

func (r *RepoPage) Blob() (*object.File, error)

func (*RepoPage) Commits

func (r *RepoPage) Commits() (*CommitInfo, error)

func (*RepoPage) Files

func (r *RepoPage) Files() ([]RepoFile, error)

func (*RepoPage) Readme

func (r *RepoPage) Readme() (string, error)

func (*RepoPage) Submodule

func (r *RepoPage) Submodule(file *RepoFile) (*object.File, error)

type WalkFunc

type WalkFunc func(string, *RepoPage) error

Jump to

Keyboard shortcuts

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