Documentation
¶
Overview ¶
Package filesystem implements an attestation collector from a fs.FS
Index ¶
- Variables
- type Collector
- func (c *Collector) Fetch(ctx context.Context, opts attestation.FetchOptions) ([]attestation.Envelope, error)
- func (c *Collector) FetchByPredicateType(ctx context.Context, opts attestation.FetchOptions, ...) ([]attestation.Envelope, error)
- func (c *Collector) FetchBySubject(ctx context.Context, opts attestation.FetchOptions, subj []attestation.Subject) ([]attestation.Envelope, error)
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 ¶
Collector is the filesystem collector
func (*Collector) Fetch ¶
func (c *Collector) Fetch(ctx context.Context, opts attestation.FetchOptions) ([]attestation.Envelope, error)
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)
Click to show internal directories.
Click to hide internal directories.