2014-03-18 20:00:41 +04:00
|
|
|
package datasource
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
type localFile struct {
|
|
|
|
path string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewLocalFile(path string) *localFile {
|
|
|
|
return &localFile{path}
|
|
|
|
}
|
|
|
|
|
2014-06-18 22:36:06 +04:00
|
|
|
func (self *localFile) ConfigRoot() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2014-03-18 20:00:41 +04:00
|
|
|
func (self *localFile) Fetch() ([]byte, error) {
|
|
|
|
return ioutil.ReadFile(self.path)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *localFile) Type() string {
|
|
|
|
return "local-file"
|
|
|
|
}
|