in experimental/config.go [33:60]
func storageFromConfig(configFile string) (storageObject, error) {
data, err := ioutil.ReadFile(configFile)
if err != nil {
return nil, err
}
config := &distributionConfig{}
err = yaml.Unmarshal(data, &config)
if err != nil {
return nil, err
}
if config.Version != "0.1" {
return nil, errors.New("only 0.1 version is supported")
}
if config.Storage.Filesystem != nil && config.Storage.S3 != nil {
return nil, errors.New("multiple storages defined")
}
if config.Storage.Filesystem != nil {
return newFilesystemStorage(config.Storage.Filesystem)
} else if config.Storage.S3 != nil {
return newS3Storage(config.Storage.S3)
} else {
return nil, errors.New("unsupported storage")
}
}