pulumi/pkg/encoding/decode.go
Joe Duffy f6e694c72b Rename pulumi-fabric to pulumi
This includes a few changes:

* The repo name -- and hence the Go modules -- changes from pulumi-fabric to pulumi.

* The Node.js SDK package changes from @pulumi/pulumi-fabric to just pulumi.

* The CLI is renamed from lumi to pulumi.
2017-09-21 19:18:21 -07:00

19 lines
631 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/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
}