content

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConventionalDefaultName added in v0.3.11

func IsConventionalDefaultName(s string) bool

IsConventionalDefaultName reports whether s is a well-known default branch or label name ("main", "master", "develop", "trunk"). It was preserved for future use even though its original caller (the GetMeta carve-out in github/getrepo.go and bitbucket/getrepo.go) was removed in Phase 25.

func IsSHA added in v0.3.11

func IsSHA(s string) bool

IsSHA reports whether s is a 40-char (SHA-1) or 64-char (SHA-256) lowercase hex string. This is the shared provider-layer definition extracted from the duplicated copies in github/getrepo.go and bitbucket/getrepo.go. The connect-layer isSHA in internal/connect/commits_helpers.go is NOT consolidated because it serves a different domain (UUID-derivation gating vs. provider-layer commit-vs-ref gating).

Types

type File

type File struct {
	Path string
	Data []byte
	Hash shake256.Hash
}

func GetFiles

func GetFiles(
	ctx context.Context,
	entries []FileEntry,
	downloadFn func(ctx context.Context, orig string) ([]byte, error),
) ([]File, error)

GetFiles downloads each entry using downloadFn, hashes the data, and returns a sorted content.File slice. The caller provides the downloadFn so this helper is provider-agnostic.

type FileEntry

type FileEntry struct {
	Orig string
	Name string
}

FileEntry represents a filtered file entry. Orig is the original path used for API calls. Name is the filtered/rewritten path used for content.File.Path.

func FilterEntries

func FilterEntries[T any](
	entries []T,
	getPath func(T) string,
	repo filter.Repo,
) []FileEntry

FilterEntries applies repo.Check() to each raw entry and returns a sorted FileEntry slice of entries that pass the filter. The getPath function extracts the file path string from each entry of type T.

type Meta

type Meta struct {
	Commit        string
	DefaultBranch string
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

Jump to

Keyboard shortcuts

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