github

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 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

Overview

Package github provides an fs.FS implementation backed by the GitHub Contents API, plus a URL parser for github.com repository URLs. It is used by rootresolver to read agent specs and skills directly from a remote repository without requiring a local clone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsURL

func IsURL(rawURL string) bool

IsURL reports whether rawURL is a recognisable github.com repository URL.

func ParseURL

func ParseURL(rawURL string) (owner, repo, ref string, err error)

ParseURL parses a github.com repository URL and returns owner, repo, and ref. If no branch is specified in the URL, ref is "HEAD".

Supported formats:

Types

type FS

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

FS implements fs.FS using the GitHub Contents API. Each FS instance maintains an in-process response cache so that repeated reads of the same path (e.g. listing agents/, then opening each file) are served without additional API calls.

Concurrency: safe for concurrent use.

func New

func New(owner, repo, ref, token string) *FS

New creates a FS for the given repository. token may be empty for public repos (unauthenticated limit: 60 req/hr). ref may be empty or "HEAD" to use the default branch.

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

Open implements fs.FS.

Jump to

Keyboard shortcuts

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