func parseResourceMeta(name string, data interface{}) (resource.Meta, error) {
	meta := resource.Meta{
		Name: name,
	}

	if data == nil {
		return meta, nil
	}
	rMap := data.(map[string]interface{})

	if val := rMap["type"]; val != nil {
		var err error
		meta.Type, err = resource.ParseType(val.(string))
		if err != nil {
			return meta, errors.Trace(err)
		}
	}

	if val := rMap["filename"]; val != nil {
		meta.Path = val.(string)
	}

	if val := rMap["description"]; val != nil {
		meta.Description = val.(string)
	}

	return meta, nil
}
// parseResourceMeta parses the provided data into a Meta, assuming
// that the data has first been checked with resourceSchema.
parseResourceMeta parses the provided data into a Meta, assuming
that the data has first been checked with resourceSchema.
// parseResourceMeta parses the provided data into a Meta assuming // that the data has first been checked with resourceSchema .
func parseResourceMeta(name string, data interface{}) (resource.Meta, error) {
	meta := resource.Meta{
		Name: name,
	}
	if data == nil {
		return meta, nil
	}
	rMap := data.(map[string]interface{})
	if val := rMap["type"]; val != nil {
		var err error
		meta.Type, err = resource.ParseType(val.(string))
		if err != nil {
			return meta, errors.Trace(err)
		}
	}
	if val := rMap["filename"]; val != nil {
		meta.Path = val.(string)
	}
	if val := rMap["description"]; val != nil {
		meta.Description = val.(string)
	}
	return meta, nil
}
func parseResourceMeta ( name string , data interface { } ) ( resource . Meta , error ) { meta := resource . Meta { Name : name , } if data == nil { return meta , nil } rMap := data . ( map [ string ] interface { } ) if val := rMap [ " " ] ; val != nil { var err error meta . Type , err = resource . ParseType ( val . ( string ) ) if err != nil { return meta , errors . Trace ( err ) } } if val := rMap [ " " ] ; val != nil { meta . Path = val . ( string ) } if val := rMap [ " " ] ; val != nil { meta . Description = val . ( string ) } return meta , nil }
parseResourceMeta parses the provided data into a Meta, assuming
that the data has first been checked with resourceSchema.
parseResourceMeta parses the provided data into a Meta assuming that the data has first been checked with resourceSchema .