sophia 8e6dcac43e
Refactor myplugin
- add mappers for command options
- move communincator and prots into their own modules
2022-04-25 12:26:07 -05:00

13 lines
361 B
Go

package myplugin
import (
pb "github.com/hashicorp/vagrant/builtin/myplugin/proto"
"github.com/mitchellh/mapstructure"
"google.golang.org/protobuf/types/known/structpb"
)
func StructToCommunincatorOptions(in *structpb.Struct) (*pb.CommunicatorOptions, error) {
var result pb.CommunicatorOptions
return &result, mapstructure.Decode(in.AsMap(), &result)
}