github.com/mgoltzsche/ctnr@v0.7.1-alpha/pkg/fs/sourcetypes.go (about) 1 package fs 2 3 import ( 4 "io" 5 ) 6 7 type Source interface { 8 // TODO: a) Replace with CalcDerivedAttrs() and Attrs() returning pointer to all attrs?! 9 // or at least let DerivedAttrs() return only derived attrs without normal attrs 10 Attrs() NodeInfo 11 DeriveAttrs() (DerivedAttrs, error) 12 Write(dest, name string, w Writer, written map[Source]string) error 13 // TODO: b) Remove and compare all attributes within FsNode after Attrs() returns all and CalcDerivedAttrs() is called 14 //Equal(other Source) (bool, error) 15 } 16 17 type FileSource interface { 18 Source 19 Readable 20 HashIfAvailable() string 21 } 22 23 type LazySource interface { 24 Source 25 Expand(dest string, w Writer, written map[Source]string) error 26 } 27 28 type Readable interface { 29 Reader() (io.ReadCloser, error) 30 }