cloudinit/datasource/file.go

30 lines
455 B
Go
Raw Normal View History

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}
}
func (self *localFile) ConfigRoot() string {
return ""
}
func (self *localFile) FetchMetadata() ([]byte, error) {
return []byte{}, nil
}
func (self *localFile) FetchUserdata() ([]byte, error) {
2014-03-18 20:00:41 +04:00
return ioutil.ReadFile(self.path)
}
func (self *localFile) Type() string {
return "local-file"
}