-
Notifications
You must be signed in to change notification settings - Fork 513
/
empty.go
48 lines (35 loc) · 940 Bytes
/
empty.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package fileresolver
import (
"context"
"io"
"github.com/anchore/syft/syft/file"
)
var _ file.WritableResolver = (*Empty)(nil)
type Empty struct{}
func (e Empty) FileContentsByLocation(_ file.Location) (io.ReadCloser, error) {
return nil, nil
}
func (e Empty) HasPath(_ string) bool {
return false
}
func (e Empty) FilesByPath(_ ...string) ([]file.Location, error) {
return nil, nil
}
func (e Empty) FilesByGlob(_ ...string) ([]file.Location, error) {
return nil, nil
}
func (e Empty) FilesByMIMEType(_ ...string) ([]file.Location, error) {
return nil, nil
}
func (e Empty) RelativeFileByPath(_ file.Location, _ string) *file.Location {
return nil
}
func (e Empty) AllLocations(_ context.Context) <-chan file.Location {
return nil
}
func (e Empty) FileMetadataByLocation(_ file.Location) (file.Metadata, error) {
return file.Metadata{}, nil
}
func (e Empty) Write(_ file.Location, _ io.Reader) error {
return nil
}