move file+gophermap --> filecontents.go to indicate parent interface
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
parent
41ecadd6ee
commit
1fdacf9e19
25
file.go
25
file.go
@ -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
|
||||
}
|
@ -6,6 +6,30 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
/* 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
|
||||
}
|
||||
|
||||
/* GophermapContents:
|
||||
* Implementation of FileContents that reads and
|
||||
* parses a gophermap file into a slice of gophermap
|
Loading…
Reference in New Issue
Block a user