Documentation
¶
Overview ¶
Package filesystem implements an attestation collector from a fs.FS
Index ¶
- Constants
- 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)
- func (c *Collector) SetKeys(keys []key.PublicKeyProvider)
Constants ¶
View Source
const SignaturePredicateType = attestation.PredicateType("https://carabiner.dev/ampel/signature/v1")
SignaturePredicateType is the predicate type for virtual signature attestations.
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 WithKey = func(keys ...key.PublicKeyProvider) fnOpts { return func(c *Collector) error { c.Keys = append(c.Keys, keys...) 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 } }
View Source
var WithSignatureExtensions = func(exts []string) fnOpts { return func(c *Collector) error { c.SignatureExtensions = exts return nil } }
View Source
var WithSigstoreBundleExtensions = func(exts []string) fnOpts { return func(c *Collector) error { c.SigstoreBundleExtensions = exts return nil } }
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
Extensions []string
SignatureExtensions []string
SigstoreBundleExtensions []string
IgnoreOtherFiles bool
Path string
FS fs.FS
Keys []key.PublicKeyProvider
}
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)
func (*Collector) SetKeys ¶ added in v0.3.0
func (c *Collector) SetKeys(keys []key.PublicKeyProvider)
SetKeys sets the verification keys used by the collector.
Click to show internal directories.
Click to hide internal directories.