github.com/openshift/installer@v1.4.17/pkg/asset/filewriter.go (about)

     1  package asset
     2  
     3  // FileWriter interface is used to write all the files in the specified location
     4  type FileWriter interface {
     5  	PersistToFile(directory string) error
     6  }
     7  
     8  // NewDefaultFileWriter create a new adapter to expose the default implementation as a FileWriter
     9  func NewDefaultFileWriter(a WritableAsset) FileWriter {
    10  	return &fileWriterAdapter{a: a}
    11  }
    12  
    13  type fileWriterAdapter struct {
    14  	a WritableAsset
    15  }
    16  
    17  // PersistToFile wraps the default implementation
    18  func (fwa *fileWriterAdapter) PersistToFile(directory string) error {
    19  	return PersistToFile(fwa.a, directory)
    20  }