Paul Hinze 0fef7cc416
Port push plugins
This uses the new Push plugin support added to the plugin SDK in https://github.com/hashicorp/vagrant-plugin-sdk/pull/106 to make the following changes:

 * The plugin manager on the Go side now registers push plugins
 * The the _remote_ plugin manager on the Ruby side now calls over to
   the go side to get push plugins
 * All the wiring is hooked up such that when a push plugin is replaced
   with its remote GRPC-client-wielding equivalent, the messages are
   ferried around.
2022-04-25 12:26:21 -05:00

21 lines
530 B
Ruby

module VagrantPlugins
module CommandServe
class Mappers
# Build a guest client from a proto instance
class PushFromProto < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::Args::Push)
i << Input.new(type: Broker)
end
super(inputs: inputs, output: Client::Push, func: method(:converter))
end
def converter(proto, broker)
Client::Push.load(proto, broker: broker)
end
end
end
end
end