Esempio n. 1
0
func MarshalText(w io.Writer, m *Manifest) error {
	var bm pb.Manifest
	for _, resource := range m.Resources {
		bm.Resource = append(bm.Resource, toProto(resource))
	}

	return proto.MarshalText(w, &bm)
}
Esempio n. 2
0
func Marshal(m *Manifest) ([]byte, error) {
	var bm pb.Manifest
	for _, resource := range m.Resources {
		bm.Resource = append(bm.Resource, toProto(resource))
	}

	return proto.Marshal(&bm)
}