@@ -257,15 +257,6 @@ func WithProfiles(profiles []string) func(*Options) {
257257 }
258258}
259259
260- // ParseYAML reads the bytes from a file, parses the bytes into a mapping
261- // structure, and returns it.
262- func ParseYAML (source []byte ) (map [string ]interface {}, error ) {
263- r := bytes .NewReader (source )
264- decoder := yaml .NewDecoder (r )
265- m , _ , err := parseYAML (decoder )
266- return m , err
267- }
268-
269260// PostProcessor is used to tweak compose model based on metadata extracted during yaml Unmarshal phase
270261// that hardly can be implemented using go-yaml and mapstructure
271262type PostProcessor interface {
@@ -275,32 +266,6 @@ type PostProcessor interface {
275266 Apply (interface {}) error
276267}
277268
278- func parseYAML (decoder * yaml.Decoder ) (map [string ]interface {}, PostProcessor , error ) {
279- var cfg interface {}
280- processor := ResetProcessor {target : & cfg }
281-
282- if err := decoder .Decode (& processor ); err != nil {
283- return nil , nil , err
284- }
285- stringMap , ok := cfg .(map [string ]interface {})
286- if ok {
287- converted , err := convertToStringKeysRecursive (stringMap , "" )
288- if err != nil {
289- return nil , nil , err
290- }
291- return converted .(map [string ]interface {}), & processor , nil
292- }
293- cfgMap , ok := cfg .(map [interface {}]interface {})
294- if ! ok {
295- return nil , nil , errors .New ("Top-level object must be a mapping" )
296- }
297- converted , err := convertToStringKeysRecursive (cfgMap , "" )
298- if err != nil {
299- return nil , nil , err
300- }
301- return converted .(map [string ]interface {}), & processor , nil
302- }
303-
304269// LoadConfigFiles ingests config files with ResourceLoader and returns config details with paths to local copies
305270func LoadConfigFiles (ctx context.Context , configFiles []string , workingDir string , options ... func (* Options )) (* types.ConfigDetails , error ) {
306271 if len (configFiles ) < 1 {
@@ -353,12 +318,6 @@ func LoadConfigFiles(ctx context.Context, configFiles []string, workingDir strin
353318 return config , nil
354319}
355320
356- // Load reads a ConfigDetails and returns a fully loaded configuration.
357- // Deprecated: use LoadWithContext.
358- func Load (configDetails types.ConfigDetails , options ... func (* Options )) (* types.Project , error ) {
359- return LoadWithContext (context .Background (), configDetails , options ... )
360- }
361-
362321// LoadWithContext reads a ConfigDetails and returns a fully loaded configuration as a compose-go Project
363322func LoadWithContext (ctx context.Context , configDetails types.ConfigDetails , options ... func (* Options )) (* types.Project , error ) {
364323 opts := toOptions (& configDetails , options )
0 commit comments