move file+gophermap --> filecontents.go to indicate parent interface
Signed-off-by: kim (grufwub) <grufwub@gmail.com>master
parent
41ecadd6ee
commit
1fdacf9e19
@ -1,25 +0,0 @@
|
||||
package main
|
||||
|
||||
/* RegularFileContents:
|
||||
* Very simple implementation of FileContents that just
|
||||
* buffered reads from the stored file path, stores the
|
||||
* read bytes in a slice and returns when requested.
|
||||
*/
|
||||
type RegularFileContents struct {
|
||||
path string
|
||||
contents []byte
|
||||
}
|
||||
|
||||
func (fc *RegularFileContents) Render() []byte {
|
||||
return fc.contents
|
||||
}
|
||||
|
||||
func (fc *RegularFileContents) Load() *GophorError {
|
||||
var gophorErr *GophorError
|
||||
fc.contents, gophorErr = bufferedRead(fc.path)
|
||||
return gophorErr
|
||||
}
|
||||
|
||||
func (fc *RegularFileContents) Clear() {
|
||||
fc.contents = nil
|
||||
}
|
Loading…
Reference in New Issue