gitrepo

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package gitrepo is the git source: a repository shallow-cloned into a cache directory and kept fresh by polling. Pure Go (go-git), so air-gapped hosts need no git binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func New

func New(name, url, branch string, paths []string, cacheDir, token string, exts []string) *Repo

New builds a git source. cacheDir is where the working copy lives (typically <data_dir>/git/<kb>-<source>). token may be empty for public repositories.

func (*Repo) List

func (r *Repo) List(ctx context.Context) ([]source.FileMeta, error)

func (*Repo) Name

func (r *Repo) Name() string

func (*Repo) Read

func (r *Repo) Read(ctx context.Context, relPath string) (io.ReadCloser, error)

func (*Repo) Sync

func (r *Repo) Sync(ctx context.Context) error

Sync clones on first use and fetch+resets afterwards. The worktree is disposable cache: any local drift is discarded.

func (*Repo) URI

func (r *Repo) URI(relPath string) string

Jump to

Keyboard shortcuts

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