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

45 lines
1.8 KiB
Ruby

require "ostruct"
module VagrantPlugins
module CommandServe
module Service
autoload :CapabilityPlatformService, Vagrant.source_root.join("plugins/commands/serve/service/capability_platform_service").to_s
autoload :CommandService, Vagrant.source_root.join("plugins/commands/serve/service/command_service").to_s
autoload :CommunicatorService, Vagrant.source_root.join("plugins/commands/serve/service/communicator_service").to_s
autoload :GuestService, Vagrant.source_root.join("plugins/commands/serve/service/guest_service").to_s
autoload :HostService, Vagrant.source_root.join("plugins/commands/serve/service/host_service").to_s
autoload :InternalService, Vagrant.source_root.join("plugins/commands/serve/service/internal_service").to_s
autoload :ProviderService, Vagrant.source_root.join("plugins/commands/serve/service/provider_service").to_s
autoload :SyncedFolderService, Vagrant.source_root.join("plugins/commands/serve/service/synced_folder_service").to_s
autoload :PushService, Vagrant.source_root.join("plugins/commands/serve/service/push_service").to_s
class ServiceInfo < OpenStruct
class << self
attr_reader :manager_tracker
end
def initialize(plugin_name: nil, broker: nil)
super()
self.plugin_name = plugin_name.to_sym if plugin_name
self.broker = broker
end
def self.info
info = Thread.current.thread_variable_get(:service_info)
if info.nil?
raise ArgumentError,
"Service information has not been set!"
end
info
end
def self.with_info(context, broker: nil)
raise NotImplementedError
end
@manager_tracker = Util::UsageTracker.new
end
end
end
end