Help us shape the future of Go! Take the 2026 Go Developer Survey

githubraw

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package githubraw downloads a reusable workflow file from raw.githubusercontent.com at a commit (ports.WorkflowFetcher). It sends no credentials, bounds the time and the size of the download, and follows no redirect to another host.

Index

Constants

View Source
const DefaultBaseURL = "https://raw.githubusercontent.com"

DefaultBaseURL is where the files are.

View Source
const DefaultTimeout = 20 * time.Second

DefaultTimeout bounds one download.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL string
	Timeout time.Duration
	Client  *http.Client
}

Config configures a Fetcher; tests replace BaseURL and Client.

type Fetcher

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

Fetcher implements ports.WorkflowFetcher over HTTPS.

func New

func New(cfg Config) *Fetcher

New builds a Fetcher.

func (*Fetcher) FetchWorkflow

func (f *Fetcher) FetchWorkflow(ctx context.Context, owner, repo, sha, path string, maxBytes int64) ([]byte, error)

FetchWorkflow downloads path of owner/repo at sha.

Jump to

Keyboard shortcuts

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