pulumi/pkg/encoding/decode.go

19 lines
638 B
Go
Raw Normal View History

2017-06-26 23:46:34 +02:00
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
// Package encoding can unmarshal LumiPack and LumiIL metadata formats. Because of their complex structure, we cannot
2017-02-25 16:25:33 +01:00
// 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
}