github

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package github implements a collector that reads from the GitHub attestations store.

Index

Constants

View Source
const (
	TypeMoniker = "github"
)

Variables

View Source
var Build = func(istr string) (attestation.Repository, error) {
	return New(WithRepo(istr))
}

Implement the factory function

View Source
var SupportedAlgorithms = []string{
	string(ita.AlgorithmSHA256), string(ita.AlgorithmSHA512),
}

Functions

func WithInit added in v0.2.7

func WithInit(init string) optFn

func WithOwner

func WithOwner(owner string) optFn

func WithRepo

func WithRepo(repo string) optFn

func WithToken added in v0.2.7

func WithToken(token string) optFn

Types

type Collector

type Collector struct {
	Options Options
	// contains filtered or unexported fields
}

func New

func New(funcs ...optFn) (*Collector, error)

New returns a new collector

func (*Collector) Fetch

Fetch queries the repository and retrieves any attestations matching the query

func (*Collector) FetchBySubject

func (c *Collector) FetchBySubject(ctx context.Context, opts attestation.FetchOptions, subj []attestation.Subject) ([]attestation.Envelope, error)

FetchBySubject is the only method supported as the GitHub api can only list attestations by subject.

func (*Collector) Store added in v0.2.5

Store implements the attestations.Storer interface

type Options

type Options struct {
	Owner string
	Repo  string
	// Access token (uses GITHUB_TOKEN if unset)
	Token string
}

Jump to

Keyboard shortcuts

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