pulumi/pkg/encoding/decode.go
joeduffy f189c40f35 Wire up Lumi to the new runtime strategy
🔥 🔥 🔥  🔥 🔥 🔥

Getting closer on #311.
2017-09-04 11:35:21 -07:00

19 lines
638 B
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
// Package encoding can unmarshal LumiPack and LumiIL metadata formats. Because of their complex structure, we cannot
// rely on the standard JSON marshaling and unmarshaling routines. Instead, we will need to do it mostly "by hand".
package encoding
import (
"github.com/pulumi/pulumi-fabric/pkg/pack"
)
// Decode unmarshals the entire contents of the given byte array into a Package object.
func Decode(m Marshaler, b []byte) (*pack.Package, error) {
var pack pack.Package
if err := m.Unmarshal(b, &pack); err != nil {
return nil, err
}
return &pack, nil
}