diff options
Diffstat (limited to 'target/memory.go')
-rw-r--r-- | target/memory.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/target/memory.go b/target/memory.go new file mode 100644 index 000000000..f8a3d91e8 --- /dev/null +++ b/target/memory.go @@ -0,0 +1,25 @@ +package target + +import ( + "io" + "bytes" +) + +type InMemoryTarget struct { + Files map[string][]byte +} + +func (t *InMemoryTarget) Publish(label string, reader io.Reader) (err error) { + if t.Files == nil { + t.Files = make(map[string][]byte) + } + bytes := new(bytes.Buffer) + bytes.ReadFrom(reader) + t.Files[label] = bytes.Bytes() + return +} + +func (t *InMemoryTarget) Translate(label string) (dest string, err error) { + return label, nil +} + |