Start Synced folder service
This commit is contained in:
parent
db259a0ed1
commit
08d4438ae1
@ -7,6 +7,8 @@ module VagrantPlugins
|
||||
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
|
||||
|
||||
|
||||
class ServiceInfo
|
||||
# @return [String] Name of requested plugin
|
||||
|
||||
79
plugins/commands/serve/service/synced_folder_service.rb
Normal file
79
plugins/commands/serve/service/synced_folder_service.rb
Normal file
@ -0,0 +1,79 @@
|
||||
require 'google/protobuf/well_known_types'
|
||||
|
||||
module VagrantPlugins
|
||||
module CommandServe
|
||||
module Service
|
||||
class SyncedFolderService < SDK::SyncedFolderService::Service
|
||||
|
||||
include CapabilityPlatformService
|
||||
|
||||
def initialize(*args, **opts, &block)
|
||||
caps = Vagrant.plugin("2").manager.synced_folder_capabilities
|
||||
default_args = [
|
||||
# Always get a target to pass the synced folder capability
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.Args.Target",
|
||||
name: "",
|
||||
),
|
||||
]
|
||||
initialize_capability_platform!(caps, default_args)
|
||||
end
|
||||
|
||||
def usable_spec(*_)
|
||||
SDK::FuncSpec.new(
|
||||
name: "usable_spec",
|
||||
args: [
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.Args.Target.Machine",
|
||||
name: "",
|
||||
)
|
||||
],
|
||||
result: [
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.SyncedFolder.UsableResp",
|
||||
name: "",
|
||||
),
|
||||
],
|
||||
)
|
||||
end
|
||||
|
||||
def usable(req, ctx)
|
||||
with_info(ctx) do |info|
|
||||
# TODO
|
||||
end
|
||||
end
|
||||
|
||||
def enable_spec(*_)
|
||||
SDK::FuncSpec.new(
|
||||
name: "enable_spec",
|
||||
args: [
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.Args.Target.Machine",
|
||||
name: "",
|
||||
),
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.Args.OptionsHash",
|
||||
name: "",
|
||||
),
|
||||
#TODO
|
||||
],
|
||||
result: [
|
||||
SDK::FuncSpec::Value.new(
|
||||
type: "hashicorp.vagrant.sdk.SyncedFolder.UsableResp",
|
||||
name: "",
|
||||
),
|
||||
],
|
||||
)
|
||||
end
|
||||
|
||||
def enable(req, ctx)
|
||||
with_info(ctx) do |info|
|
||||
# TODO
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user