content

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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