github

package
v0.0.0-...-0932ba2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 6 Imported by: ? 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

This section is empty.

Types

type Client

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

Client implements contracts.GitHub using google/go-github.

func NewClient

func NewClient() *Client

NewClient creates a new GitHub API client.

func (*Client) Close

func (c *Client) Close() error

Close shuts down the pipelines.

func (*Client) GetFileContent

func (c *Client) GetFileContent(ctx context.Context, token, owner, repo, path, ref string) (*FileContent, error)

GetFileContent retrieves the content of a single file.

func (*Client) GetFileContentBatch

func (c *Client) GetFileContentBatch(ctx context.Context, token, owner, repo, ref string, paths []string) ([]*FileContent, error)

GetFileContentBatch retrieves multiple files concurrently. Uses the resilient GetFileContent pipeline internally.

func (*Client) GetTree

func (c *Client) GetTree(ctx context.Context, token, owner, repo, ref string) ([]TreeEntry, error)

GetTree retrieves the full repository tree at a given ref.

type FileContent

type FileContent struct {
	Path    string
	SHA     string
	Content []byte
	Size    int64
}

FileContent represents the content of a file from GitHub.

type TreeEntry

type TreeEntry struct {
	Path string
	Mode string
	Type string // "blob" or "tree"
	SHA  string
	Size int64 // only for blobs
}

TreeEntry represents a file or directory in a GitHub repository tree.

Jump to

Keyboard shortcuts

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