cloudinit/datasource/file.go

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