download

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodAuto    = "auto"
	MethodTarball = "tarball"
	MethodGit     = "git"
)

Variables

View Source
var (
	ErrVersionNotFound  = errors.New("version not found upstream")
	ErrRateLimited      = errors.New("github api rate limited")
	ErrUnsafeArchive    = errors.New("unsafe archive entry")
	ErrUnexpectedLayout = errors.New("unexpected archive layout")
	ErrArchiveTooLarge  = errors.New("archive too large")
	ErrValidationFailed = errors.New("validation failed")
)

Functions

func EnsureRepo

func EnsureRepo(ctx context.Context, rc RepoConfig, opts Options) (repoPath, version string, err error)

func ExtractTarGz

func ExtractTarGz(ctx context.Context, r io.Reader, destRoot string, maxBytes int64, maxEntries int) error

Types

type Options

type Options struct {
	Version        string
	CacheDir       string
	Refresh        bool
	Method         string
	Token          string
	UserAgent      string
	MaxRetries     int
	MaxExtractedB  int64
	APIBaseURL     string
	TarballBaseURL string
	Validate       ValidateFunc
	TagFilter      TagFilterFunc
}

type RepoConfig

type RepoConfig struct {
	Owner  string
	Repo   string
	GitURL string // override; default is https://github.com/{Owner}/{Repo}.git
}

type TagFilterFunc

type TagFilterFunc func(tagName string) bool

type ValidateFunc

type ValidateFunc func(repoPath string) bool

Jump to

Keyboard shortcuts

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