filesystem

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package filesystem implements an attestation collector from a fs.FS

Index

Constants

This section is empty.

Variables

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

Implement the factory function

View Source
var TypeMoniker = "fs"
View Source
var WithFS = func(iofs fs.FS) fnOpts {
	return func(c *Collector) error {
		c.FS = iofs
		return nil
	}
}
View Source
var WithInitString = func(s string) fnOpts {
	return func(c *Collector) error {
		c.FS = os.DirFS(s)
		return nil
	}
}
View Source
var WithPath = func(path string) fnOpts {
	return func(c *Collector) error {
		c.Path = strings.TrimPrefix(path, "/")
		if c.Path == "" {
			c.Path = "."
		}
		return nil
	}
}

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Extensions       []string
	IgnoreOtherFiles bool
	Path             string
	FS               fs.FS
}

Collector is the filesystem collector

func New

func New(opts ...fnOpts) (*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)

Jump to

Keyboard shortcuts

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