github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/internal/fileresolver/empty.go (about)

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