diff --git a/file.go b/file.go index 65d82f9..15b502b 100644 --- a/file.go +++ b/file.go @@ -107,6 +107,12 @@ func (f *file) Meta() map[string]interface{} { return f.meta } +func (f *file) Apply(m map[string]interface{}) { + for key, value := range m { + f.meta[key] = value + } +} + func (f *file) Read(p []byte) (int, error) { if err := f.cache(); err != nil { return 0, err diff --git a/types.go b/types.go index e003efa..6008515 100644 --- a/types.go +++ b/types.go @@ -46,13 +46,10 @@ func New(srcDir, dstDir string) Goldsmith { type File interface { Path() string - Rename(path string) - Meta() map[string]interface{} - + Apply(m map[string]interface{}) Read(p []byte) (int, error) WriteTo(w io.Writer) (int64, error) - Rewrite(data []byte) } func NewFileFromData(path string, data []byte) File {