git

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: 11 Imported by: 0

Documentation

Overview

Package git implements an attestations collector that works on a git repository. This package implements the logic to interact with the git repo and relies on the filesystem collector to fetch and classify attestations.

Index

Constants

This section is empty.

Variables

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

Implement the factory function

View Source
var TypeMoniker = "git"

Functions

func WithLocator

func WithLocator(init string) optFn

func WithPath

func WithPath(path string) optFn

Types

type Collector

type Collector struct {
	Repo        *git.Repository
	FSCollector *filesystem.Collector
	Options     Options
}

func New

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

func (*Collector) Fetch

Fetch queries the repository and retrieves any attestations matching the query

func (*Collector) FetchByPredicateType

func (c *Collector) FetchByPredicateType(ctx context.Context, opts attestation.FetchOptions, pts []attestation.PredicateType) ([]attestation.Envelope, error)

func (*Collector) FetchBySubject

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

FetchBySubject calls the attestation reader with a filter preconfigured with subject hashes.

type Options

type Options struct {
	URL    string
	Path   string
	Ref    string
	Commit string
}

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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