Refactor proto usage

This commit is contained in:
Chris Roberts 2019-03-29 16:55:59 -07:00
parent a04e24378b
commit ca58714a03
22 changed files with 3522 additions and 4598 deletions

View File

@ -284,7 +284,7 @@ func handleGrpcError(err error, pluginCtx context.Context, reqCtx context.Contex
return errors.New("exceeded context timeout")
}
return err
} else if s != nil {
} else if s != nil && s.Message() != "" {
// Extract actual error message received
// and create new error
return errors.New(s.Message())

View File

@ -8,8 +8,7 @@ import (
go_plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_caps"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto"
"github.com/LK4D4/joincontext"
)
@ -26,7 +25,7 @@ type GuestCapabilitiesPlugin struct {
func (g *GuestCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
g.Impl.Init()
vagrant_caps.RegisterGuestCapabilitiesServer(s, &GRPCGuestCapabilitiesServer{
vagrant_proto.RegisterGuestCapabilitiesServer(s, &GRPCGuestCapabilitiesServer{
Impl: g.Impl,
GRPCIOServer: GRPCIOServer{
Impl: g.Impl}})
@ -34,7 +33,7 @@ func (g *GuestCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *gr
}
func (g *GuestCapabilitiesPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
client := vagrant_caps.NewGuestCapabilitiesClient(c)
client := vagrant_proto.NewGuestCapabilitiesClient(c)
return &GRPCGuestCapabilitiesClient{
client: client,
doneCtx: ctx,
@ -48,13 +47,20 @@ type GRPCGuestCapabilitiesServer struct {
Impl GuestCapabilities
}
func (s *GRPCGuestCapabilitiesServer) GuestCapabilities(ctx context.Context, req *vagrant_common.NullRequest) (resp *vagrant_caps.CapabilitiesResponse, err error) {
resp = &vagrant_caps.CapabilitiesResponse{}
func (s *GRPCGuestCapabilitiesServer) GuestCapabilities(ctx context.Context, req *vagrant_proto.Empty) (resp *vagrant_proto.SystemCapabilityList, err error) {
resp = &vagrant_proto.SystemCapabilityList{}
var r []vagrant.SystemCapability
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
defer func() { n <- struct{}{} }()
r, err = s.Impl.GuestCapabilities()
n <- struct{}{}
if err != nil {
return
}
for _, cap := range r {
rcap := &vagrant_proto.SystemCapability{Name: cap.Name, Platform: cap.Platform}
resp.Capabilities = append(resp.Capabilities, rcap)
}
}()
select {
case <-ctx.Done():
@ -64,15 +70,11 @@ func (s *GRPCGuestCapabilitiesServer) GuestCapabilities(ctx context.Context, req
if err != nil {
return
}
for _, cap := range r {
rcap := &vagrant_caps.Capability{Name: cap.Name, Platform: cap.Platform}
resp.Capabilities = append(resp.Capabilities, rcap)
}
return
}
func (s *GRPCGuestCapabilitiesServer) GuestCapability(ctx context.Context, req *vagrant_caps.GuestCapabilityRequest) (resp *vagrant_caps.GuestCapabilityResponse, err error) {
resp = &vagrant_caps.GuestCapabilityResponse{}
func (s *GRPCGuestCapabilitiesServer) GuestCapability(ctx context.Context, req *vagrant_proto.GuestCapabilityRequest) (resp *vagrant_proto.GenericResponse, err error) {
resp = &vagrant_proto.GenericResponse{}
var args, r interface{}
if err = json.Unmarshal([]byte(req.Arguments), &args); err != nil {
return
@ -84,17 +86,15 @@ func (s *GRPCGuestCapabilitiesServer) GuestCapability(ctx context.Context, req *
cap := &vagrant.SystemCapability{
Name: req.Capability.Name,
Platform: req.Capability.Platform}
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
defer func() { n <- struct{}{} }()
r, err = s.Impl.GuestCapability(ctx, cap, args, machine)
n <- struct{}{}
}()
select {
case <-ctx.Done():
return
case <-n:
}
if err != nil {
return
}
@ -109,14 +109,14 @@ func (s *GRPCGuestCapabilitiesServer) GuestCapability(ctx context.Context, req *
type GRPCGuestCapabilitiesClient struct {
GRPCCoreClient
GRPCIOClient
client vagrant_caps.GuestCapabilitiesClient
client vagrant_proto.GuestCapabilitiesClient
doneCtx context.Context
}
func (c *GRPCGuestCapabilitiesClient) GuestCapabilities() (caps []vagrant.SystemCapability, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.GuestCapabilities(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.GuestCapabilities(jctx, &vagrant_proto.Empty{})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
@ -140,8 +140,8 @@ func (c *GRPCGuestCapabilitiesClient) GuestCapability(ctx context.Context, cap *
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.GuestCapability(jctx, &vagrant_caps.GuestCapabilityRequest{
Capability: &vagrant_caps.Capability{Name: cap.Name, Platform: cap.Platform},
resp, err := c.client.GuestCapability(jctx, &vagrant_proto.GuestCapabilityRequest{
Capability: &vagrant_proto.SystemCapability{Name: cap.Name, Platform: cap.Platform},
Machine: m,
Arguments: string(a)})
if err != nil {
@ -163,7 +163,7 @@ type HostCapabilitiesPlugin struct {
func (h *HostCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
h.Impl.Init()
vagrant_caps.RegisterHostCapabilitiesServer(s, &GRPCHostCapabilitiesServer{
vagrant_proto.RegisterHostCapabilitiesServer(s, &GRPCHostCapabilitiesServer{
Impl: h.Impl,
GRPCIOServer: GRPCIOServer{
Impl: h.Impl}})
@ -171,7 +171,7 @@ func (h *HostCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grp
}
func (h *HostCapabilitiesPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
client := vagrant_caps.NewHostCapabilitiesClient(c)
client := vagrant_proto.NewHostCapabilitiesClient(c)
return &GRPCHostCapabilitiesClient{
client: client,
doneCtx: ctx,
@ -185,10 +185,10 @@ type GRPCHostCapabilitiesServer struct {
Impl HostCapabilities
}
func (s *GRPCHostCapabilitiesServer) HostCapabilities(ctx context.Context, req *vagrant_common.NullRequest) (resp *vagrant_caps.CapabilitiesResponse, err error) {
resp = &vagrant_caps.CapabilitiesResponse{}
func (s *GRPCHostCapabilitiesServer) HostCapabilities(ctx context.Context, req *vagrant_proto.Empty) (resp *vagrant_proto.SystemCapabilityList, err error) {
resp = &vagrant_proto.SystemCapabilityList{}
var r []vagrant.SystemCapability
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r, err = s.Impl.HostCapabilities()
n <- struct{}{}
@ -202,14 +202,14 @@ func (s *GRPCHostCapabilitiesServer) HostCapabilities(ctx context.Context, req *
return
}
for _, cap := range r {
rcap := &vagrant_caps.Capability{Name: cap.Name, Platform: cap.Platform}
rcap := &vagrant_proto.SystemCapability{Name: cap.Name, Platform: cap.Platform}
resp.Capabilities = append(resp.Capabilities, rcap)
}
return
}
func (s *GRPCHostCapabilitiesServer) HostCapability(ctx context.Context, req *vagrant_caps.HostCapabilityRequest) (resp *vagrant_caps.HostCapabilityResponse, err error) {
resp = &vagrant_caps.HostCapabilityResponse{}
func (s *GRPCHostCapabilitiesServer) HostCapability(ctx context.Context, req *vagrant_proto.HostCapabilityRequest) (resp *vagrant_proto.GenericResponse, err error) {
resp = &vagrant_proto.GenericResponse{}
var args, r interface{}
if err = json.Unmarshal([]byte(req.Arguments), &args); err != nil {
return
@ -221,7 +221,7 @@ func (s *GRPCHostCapabilitiesServer) HostCapability(ctx context.Context, req *va
cap := &vagrant.SystemCapability{
Name: req.Capability.Name,
Platform: req.Capability.Platform}
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r, err = s.Impl.HostCapability(ctx, cap, args, env)
n <- struct{}{}
@ -245,14 +245,14 @@ func (s *GRPCHostCapabilitiesServer) HostCapability(ctx context.Context, req *va
type GRPCHostCapabilitiesClient struct {
GRPCCoreClient
GRPCIOClient
client vagrant_caps.HostCapabilitiesClient
client vagrant_proto.HostCapabilitiesClient
doneCtx context.Context
}
func (c *GRPCHostCapabilitiesClient) HostCapabilities() (caps []vagrant.SystemCapability, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.HostCapabilities(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.HostCapabilities(jctx, &vagrant_proto.Empty{})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
@ -276,8 +276,8 @@ func (c *GRPCHostCapabilitiesClient) HostCapability(ctx context.Context, cap *va
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.HostCapability(jctx, &vagrant_caps.HostCapabilityRequest{
Capability: &vagrant_caps.Capability{
resp, err := c.client.HostCapability(jctx, &vagrant_proto.HostCapabilityRequest{
Capability: &vagrant_proto.SystemCapability{
Name: cap.Name,
Platform: cap.Platform},
Environment: e,
@ -301,7 +301,7 @@ type ProviderCapabilitiesPlugin struct {
func (p *ProviderCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
p.Impl.Init()
vagrant_caps.RegisterProviderCapabilitiesServer(s, &GRPCProviderCapabilitiesServer{
vagrant_proto.RegisterProviderCapabilitiesServer(s, &GRPCProviderCapabilitiesServer{
Impl: p.Impl,
GRPCIOServer: GRPCIOServer{
Impl: p.Impl}})
@ -309,7 +309,7 @@ func (p *ProviderCapabilitiesPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s
}
func (p *ProviderCapabilitiesPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
client := vagrant_caps.NewProviderCapabilitiesClient(c)
client := vagrant_proto.NewProviderCapabilitiesClient(c)
return &GRPCProviderCapabilitiesClient{
client: client,
doneCtx: ctx,
@ -323,10 +323,10 @@ type GRPCProviderCapabilitiesServer struct {
Impl ProviderCapabilities
}
func (s *GRPCProviderCapabilitiesServer) ProviderCapabilities(ctx context.Context, req *vagrant_common.NullRequest) (resp *vagrant_caps.ProviderCapabilitiesResponse, err error) {
resp = &vagrant_caps.ProviderCapabilitiesResponse{}
func (s *GRPCProviderCapabilitiesServer) ProviderCapabilities(ctx context.Context, req *vagrant_proto.Empty) (resp *vagrant_proto.ProviderCapabilityList, err error) {
resp = &vagrant_proto.ProviderCapabilityList{}
var r []vagrant.ProviderCapability
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r, err = s.Impl.ProviderCapabilities()
n <- struct{}{}
@ -340,14 +340,14 @@ func (s *GRPCProviderCapabilitiesServer) ProviderCapabilities(ctx context.Contex
return
}
for _, cap := range r {
rcap := &vagrant_caps.ProviderCapability{Name: cap.Name, Provider: cap.Provider}
rcap := &vagrant_proto.ProviderCapability{Name: cap.Name, Provider: cap.Provider}
resp.Capabilities = append(resp.Capabilities, rcap)
}
return
}
func (s *GRPCProviderCapabilitiesServer) ProviderCapability(ctx context.Context, req *vagrant_caps.ProviderCapabilityRequest) (resp *vagrant_caps.ProviderCapabilityResponse, err error) {
resp = &vagrant_caps.ProviderCapabilityResponse{}
func (s *GRPCProviderCapabilitiesServer) ProviderCapability(ctx context.Context, req *vagrant_proto.ProviderCapabilityRequest) (resp *vagrant_proto.GenericResponse, err error) {
resp = &vagrant_proto.GenericResponse{}
var args, r interface{}
err = json.Unmarshal([]byte(req.Arguments), &args)
if err != nil {
@ -384,14 +384,14 @@ func (s *GRPCProviderCapabilitiesServer) ProviderCapability(ctx context.Context,
type GRPCProviderCapabilitiesClient struct {
GRPCCoreClient
GRPCIOClient
client vagrant_caps.ProviderCapabilitiesClient
client vagrant_proto.ProviderCapabilitiesClient
doneCtx context.Context
}
func (c *GRPCProviderCapabilitiesClient) ProviderCapabilities() (caps []vagrant.ProviderCapability, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ProviderCapabilities(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.ProviderCapabilities(jctx, &vagrant_proto.Empty{})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
@ -415,8 +415,8 @@ func (c *GRPCProviderCapabilitiesClient) ProviderCapability(ctx context.Context,
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ProviderCapability(jctx, &vagrant_caps.ProviderCapabilityRequest{
Capability: &vagrant_caps.ProviderCapability{
resp, err := c.client.ProviderCapability(jctx, &vagrant_proto.ProviderCapabilityRequest{
Capability: &vagrant_proto.ProviderCapability{
Name: cap.Name,
Provider: cap.Provider},
Machine: m,

View File

@ -8,8 +8,7 @@ import (
go_plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_config"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto"
"github.com/LK4D4/joincontext"
)
@ -26,7 +25,7 @@ type ConfigPlugin struct {
func (c *ConfigPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
c.Impl.Init()
vagrant_config.RegisterConfigServer(s, &GRPCConfigServer{
vagrant_proto.RegisterConfigServer(s, &GRPCConfigServer{
Impl: c.Impl,
GRPCIOServer: GRPCIOServer{
Impl: c.Impl}})
@ -34,7 +33,7 @@ func (c *ConfigPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server)
}
func (c *ConfigPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, con *grpc.ClientConn) (interface{}, error) {
client := vagrant_config.NewConfigClient(con)
client := vagrant_proto.NewConfigClient(con)
return &GRPCConfigClient{
client: client,
doneCtx: ctx,
@ -48,11 +47,11 @@ type GRPCConfigServer struct {
Impl Config
}
func (s *GRPCConfigServer) ConfigAttributes(ctx context.Context, req *vagrant_common.NullRequest) (resp *vagrant_config.AttributesResponse, err error) {
resp = &vagrant_config.AttributesResponse{}
func (s *GRPCConfigServer) ConfigAttributes(ctx context.Context, req *vagrant_proto.Empty) (resp *vagrant_proto.ListResponse, err error) {
resp = &vagrant_proto.ListResponse{}
n := make(chan struct{}, 1)
go func() {
resp.Attributes, err = s.Impl.ConfigAttributes()
resp.Items, err = s.Impl.ConfigAttributes()
n <- struct{}{}
}()
select {
@ -62,14 +61,14 @@ func (s *GRPCConfigServer) ConfigAttributes(ctx context.Context, req *vagrant_co
return
}
func (s *GRPCConfigServer) ConfigLoad(ctx context.Context, req *vagrant_config.LoadRequest) (resp *vagrant_config.LoadResponse, err error) {
resp = &vagrant_config.LoadResponse{}
func (s *GRPCConfigServer) ConfigLoad(ctx context.Context, req *vagrant_proto.Configuration) (resp *vagrant_proto.Configuration, err error) {
resp = &vagrant_proto.Configuration{}
var data, r map[string]interface{}
err = json.Unmarshal([]byte(req.Data), &data)
if err != nil {
return
}
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r, err = s.Impl.ConfigLoad(ctx, data)
n <- struct{}{}
@ -93,8 +92,8 @@ func (s *GRPCConfigServer) ConfigLoad(ctx context.Context, req *vagrant_config.L
return
}
func (s *GRPCConfigServer) ConfigValidate(ctx context.Context, req *vagrant_config.ValidateRequest) (resp *vagrant_config.ValidateResponse, err error) {
resp = &vagrant_config.ValidateResponse{}
func (s *GRPCConfigServer) ConfigValidate(ctx context.Context, req *vagrant_proto.Configuration) (resp *vagrant_proto.ListResponse, err error) {
resp = &vagrant_proto.ListResponse{}
var data map[string]interface{}
err = json.Unmarshal([]byte(req.Data), &data)
if err != nil {
@ -104,9 +103,9 @@ func (s *GRPCConfigServer) ConfigValidate(ctx context.Context, req *vagrant_conf
if err != nil {
return
}
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
resp.Errors, err = s.Impl.ConfigValidate(ctx, data, m)
resp.Items, err = s.Impl.ConfigValidate(ctx, data, m)
n <- struct{}{}
}()
@ -118,14 +117,14 @@ func (s *GRPCConfigServer) ConfigValidate(ctx context.Context, req *vagrant_conf
return
}
func (s *GRPCConfigServer) ConfigFinalize(ctx context.Context, req *vagrant_config.FinalizeRequest) (resp *vagrant_config.FinalizeResponse, err error) {
resp = &vagrant_config.FinalizeResponse{}
func (s *GRPCConfigServer) ConfigFinalize(ctx context.Context, req *vagrant_proto.Configuration) (resp *vagrant_proto.Configuration, err error) {
resp = &vagrant_proto.Configuration{}
var data, r map[string]interface{}
err = json.Unmarshal([]byte(req.Data), &data)
if err != nil {
return
}
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r, err = s.Impl.ConfigFinalize(ctx, data)
n <- struct{}{}
@ -151,18 +150,18 @@ func (s *GRPCConfigServer) ConfigFinalize(ctx context.Context, req *vagrant_conf
type GRPCConfigClient struct {
GRPCCoreClient
GRPCIOClient
client vagrant_config.ConfigClient
client vagrant_proto.ConfigClient
doneCtx context.Context
}
func (c *GRPCConfigClient) ConfigAttributes() (attrs []string, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ConfigAttributes(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.ConfigAttributes(jctx, &vagrant_proto.Empty{})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, nil)
}
attrs = resp.Attributes
attrs = resp.Items
return
}
@ -172,7 +171,7 @@ func (c *GRPCConfigClient) ConfigLoad(ctx context.Context, data map[string]inter
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ConfigLoad(jctx, &vagrant_config.LoadRequest{
resp, err := c.client.ConfigLoad(jctx, &vagrant_proto.Configuration{
Data: string(mdata)})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
@ -191,13 +190,13 @@ func (c *GRPCConfigClient) ConfigValidate(ctx context.Context, data map[string]i
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ConfigValidate(jctx, &vagrant_config.ValidateRequest{
resp, err := c.client.ConfigValidate(jctx, &vagrant_proto.Configuration{
Data: string(mdata),
Machine: machData})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
errs = resp.Errors
errs = resp.Items
return
}
@ -207,7 +206,7 @@ func (c *GRPCConfigClient) ConfigFinalize(ctx context.Context, data map[string]i
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.ConfigFinalize(jctx, &vagrant_config.FinalizeRequest{
resp, err := c.client.ConfigFinalize(jctx, &vagrant_proto.Configuration{
Data: string(mdata)})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)

View File

@ -7,7 +7,7 @@ import (
go_plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto"
"github.com/LK4D4/joincontext"
)
@ -25,11 +25,11 @@ type GRPCIOServer struct {
Impl vagrant.StreamIO
}
func (s *GRPCIOServer) Read(ctx context.Context, req *vagrant_io.ReadRequest) (r *vagrant_io.ReadResponse, err error) {
r = &vagrant_io.ReadResponse{}
n := make(chan struct{}, 1)
func (s *GRPCIOServer) Read(ctx context.Context, req *vagrant_proto.Identifier) (r *vagrant_proto.Content, err error) {
r = &vagrant_proto.Content{}
n := make(chan struct{})
go func() {
r.Content, err = s.Impl.Read(req.Target)
r.Value, err = s.Impl.Read(req.Name)
n <- struct{}{}
}()
select {
@ -39,12 +39,12 @@ func (s *GRPCIOServer) Read(ctx context.Context, req *vagrant_io.ReadRequest) (r
return
}
func (s *GRPCIOServer) Write(ctx context.Context, req *vagrant_io.WriteRequest) (r *vagrant_io.WriteResponse, err error) {
r = &vagrant_io.WriteResponse{}
n := make(chan struct{}, 1)
func (s *GRPCIOServer) Write(ctx context.Context, req *vagrant_proto.Content) (r *vagrant_proto.WriteResponse, err error) {
r = &vagrant_proto.WriteResponse{}
n := make(chan struct{})
bytes := 0
go func() {
bytes, err = s.Impl.Write(req.Content, req.Target)
bytes, err = s.Impl.Write(req.Value, req.Target)
n <- struct{}{}
}()
select {
@ -57,28 +57,28 @@ func (s *GRPCIOServer) Write(ctx context.Context, req *vagrant_io.WriteRequest)
}
type GRPCIOClient struct {
client vagrant_io.IOClient
client vagrant_proto.IOClient
doneCtx context.Context
}
func (c *GRPCIOClient) Read(target string) (content string, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.Read(jctx, &vagrant_io.ReadRequest{
Target: target})
resp, err := c.client.Read(jctx, &vagrant_proto.Identifier{
Name: target})
if err != nil {
return content, handleGrpcError(err, c.doneCtx, ctx)
}
content = resp.Content
content = resp.Value
return
}
func (c *GRPCIOClient) Write(content, target string) (length int, err error) {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.Write(jctx, &vagrant_io.WriteRequest{
Content: content,
Target: target})
resp, err := c.client.Write(jctx, &vagrant_proto.Content{
Value: content,
Target: target})
if err != nil {
return length, handleGrpcError(err, c.doneCtx, ctx)
}
@ -87,12 +87,12 @@ func (c *GRPCIOClient) Write(content, target string) (length int, err error) {
}
func (i *IOPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
vagrant_io.RegisterIOServer(s, &GRPCIOServer{Impl: i.Impl})
vagrant_proto.RegisterIOServer(s, &GRPCIOServer{Impl: i.Impl})
return nil
}
func (i *IOPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
return &GRPCIOClient{
client: vagrant_io.NewIOClient(c),
client: vagrant_proto.NewIOClient(c),
doneCtx: ctx}, nil
}

View File

@ -6,7 +6,18 @@ for i in *
do
if [ -d "${i}" ]; then
protoc --proto_path=`go env GOPATH`/src --proto_path=. --go_out=plugins=grpc:. "${i}"/*.proto;
if [ $? -ne 0 ]; then
echo "failed!"
exit 1
fi
fi
done
protoc --proto_path=`go env GOPATH`/src --proto_path=. --go_out=plugins=grpc:. *.proto;
if [ $? -ne 0 ]; then
echo "failed!"
exit 1
fi
echo "done!"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,196 @@
syntax = "proto3";
package vagrant.proto;
message Empty{}
message Machine {
string machine = 1;
}
message Valid {
bool result = 1;
}
message Identifier {
string name = 1;
}
message PluginInfo {
string description = 1;
int64 priority = 2;
}
message Content {
string target = 1;
string value = 2;
}
message WriteResponse {
int32 length = 1;
}
service IO {
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
}
message SystemCapability {
string name = 1;
string platform = 2;
}
message ProviderCapability {
string name = 1;
string provider = 2;
}
message SystemCapabilityList {
repeated SystemCapability capabilities = 1;
}
message ProviderCapabilityList {
repeated ProviderCapability capabilities = 1;
}
message GenericResponse {
string result = 1;
}
message GuestCapabilityRequest {
SystemCapability capability = 1;
string machine = 2;
string arguments = 3;
}
message HostCapabilityRequest {
SystemCapability capability = 1;
string environment = 2;
string arguments = 3;
}
message ProviderCapabilityRequest {
ProviderCapability capability = 1;
string machine = 2;
string arguments = 3;
}
service GuestCapabilities {
rpc GuestCapabilities(Empty) returns (SystemCapabilityList);
rpc GuestCapability(GuestCapabilityRequest) returns (GenericResponse);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
}
service HostCapabilities {
rpc HostCapabilities(Empty) returns (SystemCapabilityList);
rpc HostCapability(HostCapabilityRequest) returns (GenericResponse);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
}
service ProviderCapabilities {
rpc ProviderCapabilities (Empty) returns (ProviderCapabilityList);
rpc ProviderCapability (ProviderCapabilityRequest) returns (GenericResponse);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
}
message Configuration {
string data = 1;
string machine = 2;
}
message ListResponse {
repeated string items = 1;
}
service Config {
rpc ConfigAttributes(Empty) returns (ListResponse);
rpc ConfigLoad(Configuration) returns (Configuration);
rpc ConfigValidate(Configuration) returns (ListResponse);
rpc ConfigFinalize(Configuration) returns (Configuration);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
}
message SyncedFolders {
string machine = 1;
string folders = 2;
string options = 3;
}
service SyncedFolder {
rpc Cleanup(SyncedFolders) returns (Empty);
rpc Disable(SyncedFolders) returns (Empty);
rpc Enable(SyncedFolders) returns (Empty);
rpc Info(Empty) returns (PluginInfo);
rpc IsUsable(Machine) returns (Valid);
rpc Name(Empty) returns (Identifier);
rpc Prepare(SyncedFolders) returns (Empty);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
// Guest capabilities helpers (copied from GuestCapabilities service)
rpc GuestCapabilities(Empty) returns (SystemCapabilityList);
rpc GuestCapability(GuestCapabilityRequest) returns (GenericResponse);
// Host capabilities helpers (copied from GuestCapabilities service)
rpc HostCapabilities(Empty) returns (SystemCapabilityList);
rpc HostCapability(HostCapabilityRequest) returns (GenericResponse);
}
message GenericAction {
string name = 1;
string machine = 2;
}
message ExecuteAction {
string name = 1;
string data = 2;
string machine = 3;
}
message MachineSshInfo {
string host = 1;
int64 port = 2;
string private_key_path = 3;
string username = 4;
}
message MachineState {
string id = 1;
string short_description = 2;
string long_description = 3;
}
service Provider {
rpc Action(GenericAction) returns (ListResponse);
rpc Info(Empty) returns (PluginInfo);
rpc IsInstalled(Machine) returns (Valid);
rpc IsUsable(Machine) returns (Valid);
rpc MachineIdChanged(Machine) returns (Machine);
rpc Name(Empty) returns (Identifier);
rpc RunAction(ExecuteAction) returns (GenericResponse);
rpc SshInfo(Machine) returns (MachineSshInfo);
rpc State(Machine) returns (MachineState);
// IO helpers for streaming (copied from Stream service)
rpc Read(Identifier) returns (Content);
rpc Write(Content) returns (WriteResponse);
// Config helpers (copied from Config service)
rpc ConfigAttributes(Empty) returns (ListResponse);
rpc ConfigLoad(Configuration) returns (Configuration);
rpc ConfigValidate(Configuration) returns (ListResponse);
rpc ConfigFinalize(Configuration) returns (Configuration);
// Guest capabilities helpers (copied from GuestCapabilities service)
rpc GuestCapabilities(Empty) returns (SystemCapabilityList);
rpc GuestCapability(GuestCapabilityRequest) returns (GenericResponse);
// Host capabilities helpers (copied from HostCapabilities service)
rpc HostCapabilities(Empty) returns (SystemCapabilityList);
rpc HostCapability(HostCapabilityRequest) returns (GenericResponse);
// Provider capabilities helpers (copied from ProviderCapabilities service)
rpc ProviderCapabilities (Empty) returns (ProviderCapabilityList);
rpc ProviderCapability (ProviderCapabilityRequest) returns (GenericResponse);
}

View File

@ -1,82 +0,0 @@
syntax = "proto3";
package vagrant.caps;
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common/common.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io/io.proto";
message Capability {
string name = 1;
string platform = 2;
}
message ProviderCapability {
string name = 1;
string provider = 2;
}
message ProviderCapabilitiesResponse {
repeated ProviderCapability capabilities = 1;
string error = 2;
}
message ProviderCapabilityRequest {
ProviderCapability capability = 1;
string machine = 2;
string arguments = 3;
}
message ProviderCapabilityResponse {
string result = 1;
string error = 2;
}
message CapabilitiesResponse {
repeated Capability capabilities = 1;
string error = 2;
}
message GuestCapabilityRequest {
Capability capability = 1;
string machine = 2;
string arguments = 3;
}
message GuestCapabilityResponse {
string result = 1;
string error = 2;
}
message HostCapabilityRequest {
Capability capability = 1;
string environment = 2;
string arguments = 3;
}
message HostCapabilityResponse {
string result = 1;
string error = 2;
}
service GuestCapabilities {
rpc GuestCapabilities(vagrant.common.NullRequest) returns (CapabilitiesResponse);
rpc GuestCapability(GuestCapabilityRequest) returns (GuestCapabilityResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
}
service HostCapabilities {
rpc HostCapabilities(vagrant.common.NullRequest) returns (CapabilitiesResponse);
rpc HostCapability(HostCapabilityRequest) returns (HostCapabilityResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
}
service ProviderCapabilities {
rpc ProviderCapabilities(vagrant.common.NullRequest) returns (ProviderCapabilitiesResponse);
rpc ProviderCapability(ProviderCapabilityRequest) returns (ProviderCapabilityResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
}

View File

@ -1,235 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: vagrant_common/common.proto
package vagrant_common
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type NullRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NullRequest) Reset() { *m = NullRequest{} }
func (m *NullRequest) String() string { return proto.CompactTextString(m) }
func (*NullRequest) ProtoMessage() {}
func (*NullRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_86eb89499a7c6603, []int{0}
}
func (m *NullRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NullRequest.Unmarshal(m, b)
}
func (m *NullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NullRequest.Marshal(b, m, deterministic)
}
func (m *NullRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_NullRequest.Merge(m, src)
}
func (m *NullRequest) XXX_Size() int {
return xxx_messageInfo_NullRequest.Size(m)
}
func (m *NullRequest) XXX_DiscardUnknown() {
xxx_messageInfo_NullRequest.DiscardUnknown(m)
}
var xxx_messageInfo_NullRequest proto.InternalMessageInfo
type EmptyRequest struct {
Machine string `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *EmptyRequest) Reset() { *m = EmptyRequest{} }
func (m *EmptyRequest) String() string { return proto.CompactTextString(m) }
func (*EmptyRequest) ProtoMessage() {}
func (*EmptyRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_86eb89499a7c6603, []int{1}
}
func (m *EmptyRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EmptyRequest.Unmarshal(m, b)
}
func (m *EmptyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EmptyRequest.Marshal(b, m, deterministic)
}
func (m *EmptyRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_EmptyRequest.Merge(m, src)
}
func (m *EmptyRequest) XXX_Size() int {
return xxx_messageInfo_EmptyRequest.Size(m)
}
func (m *EmptyRequest) XXX_DiscardUnknown() {
xxx_messageInfo_EmptyRequest.DiscardUnknown(m)
}
var xxx_messageInfo_EmptyRequest proto.InternalMessageInfo
func (m *EmptyRequest) GetMachine() string {
if m != nil {
return m.Machine
}
return ""
}
type EmptyResponse struct {
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
func (*EmptyResponse) ProtoMessage() {}
func (*EmptyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_86eb89499a7c6603, []int{2}
}
func (m *EmptyResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EmptyResponse.Unmarshal(m, b)
}
func (m *EmptyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EmptyResponse.Marshal(b, m, deterministic)
}
func (m *EmptyResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_EmptyResponse.Merge(m, src)
}
func (m *EmptyResponse) XXX_Size() int {
return xxx_messageInfo_EmptyResponse.Size(m)
}
func (m *EmptyResponse) XXX_DiscardUnknown() {
xxx_messageInfo_EmptyResponse.DiscardUnknown(m)
}
var xxx_messageInfo_EmptyResponse proto.InternalMessageInfo
func (m *EmptyResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type IsResponse struct {
Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IsResponse) Reset() { *m = IsResponse{} }
func (m *IsResponse) String() string { return proto.CompactTextString(m) }
func (*IsResponse) ProtoMessage() {}
func (*IsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_86eb89499a7c6603, []int{3}
}
func (m *IsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IsResponse.Unmarshal(m, b)
}
func (m *IsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IsResponse.Marshal(b, m, deterministic)
}
func (m *IsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_IsResponse.Merge(m, src)
}
func (m *IsResponse) XXX_Size() int {
return xxx_messageInfo_IsResponse.Size(m)
}
func (m *IsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_IsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_IsResponse proto.InternalMessageInfo
func (m *IsResponse) GetResult() bool {
if m != nil {
return m.Result
}
return false
}
func (m *IsResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type NameResponse struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NameResponse) Reset() { *m = NameResponse{} }
func (m *NameResponse) String() string { return proto.CompactTextString(m) }
func (*NameResponse) ProtoMessage() {}
func (*NameResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_86eb89499a7c6603, []int{4}
}
func (m *NameResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NameResponse.Unmarshal(m, b)
}
func (m *NameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NameResponse.Marshal(b, m, deterministic)
}
func (m *NameResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_NameResponse.Merge(m, src)
}
func (m *NameResponse) XXX_Size() int {
return xxx_messageInfo_NameResponse.Size(m)
}
func (m *NameResponse) XXX_DiscardUnknown() {
xxx_messageInfo_NameResponse.DiscardUnknown(m)
}
var xxx_messageInfo_NameResponse proto.InternalMessageInfo
func (m *NameResponse) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func init() {
proto.RegisterType((*NullRequest)(nil), "vagrant.common.NullRequest")
proto.RegisterType((*EmptyRequest)(nil), "vagrant.common.EmptyRequest")
proto.RegisterType((*EmptyResponse)(nil), "vagrant.common.EmptyResponse")
proto.RegisterType((*IsResponse)(nil), "vagrant.common.IsResponse")
proto.RegisterType((*NameResponse)(nil), "vagrant.common.NameResponse")
}
func init() { proto.RegisterFile("vagrant_common/common.proto", fileDescriptor_86eb89499a7c6603) }
var fileDescriptor_86eb89499a7c6603 = []byte{
// 178 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0x4b, 0x4c, 0x2f,
0x4a, 0xcc, 0x2b, 0x89, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x87, 0x50, 0x7a, 0x05, 0x45,
0xf9, 0x25, 0xf9, 0x42, 0x7c, 0x50, 0x49, 0x3d, 0x88, 0xa8, 0x12, 0x2f, 0x17, 0xb7, 0x5f, 0x69,
0x4e, 0x4e, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x92, 0x06, 0x17, 0x8f, 0x6b, 0x6e, 0x41,
0x49, 0x25, 0x94, 0x2f, 0x24, 0xc1, 0xc5, 0x9e, 0x9b, 0x98, 0x9c, 0x91, 0x99, 0x97, 0x2a, 0xc1,
0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe3, 0x2a, 0xa9, 0x72, 0xf1, 0x42, 0x55, 0x16, 0x17, 0xe4,
0xe7, 0x15, 0xa7, 0x0a, 0x89, 0x70, 0xb1, 0xa6, 0x16, 0x15, 0xe5, 0x17, 0x41, 0x15, 0x42, 0x38,
0x4a, 0x56, 0x5c, 0x5c, 0x9e, 0xc5, 0x70, 0x35, 0x62, 0x5c, 0x6c, 0x45, 0xa9, 0xc5, 0xa5, 0x39,
0x25, 0x60, 0x45, 0x1c, 0x41, 0x50, 0x1e, 0x42, 0x2f, 0x13, 0xb2, 0x5e, 0x25, 0x2e, 0x1e, 0xbf,
0xc4, 0xdc, 0x54, 0xb8, 0x6e, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0x5c, 0x98, 0x4b, 0xc0, 0xec, 0x24,
0x36, 0xb0, 0xb7, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x02, 0xed, 0x61, 0x90, 0xf5, 0x00,
0x00, 0x00,
}

View File

@ -1,19 +0,0 @@
syntax = "proto3";
package vagrant.common;
message NullRequest {}
message EmptyRequest {
string machine = 1;
}
message EmptyResponse {
string error = 1;
}
message IsResponse {
bool result = 1;
string error = 2;
}
message NameResponse { string name = 1; }

View File

@ -1,613 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: vagrant_config/config.proto
package vagrant_config
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import vagrant_common "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
import vagrant_io "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type AttributesResponse struct {
Attributes []string `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AttributesResponse) Reset() { *m = AttributesResponse{} }
func (m *AttributesResponse) String() string { return proto.CompactTextString(m) }
func (*AttributesResponse) ProtoMessage() {}
func (*AttributesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{0}
}
func (m *AttributesResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AttributesResponse.Unmarshal(m, b)
}
func (m *AttributesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AttributesResponse.Marshal(b, m, deterministic)
}
func (m *AttributesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_AttributesResponse.Merge(m, src)
}
func (m *AttributesResponse) XXX_Size() int {
return xxx_messageInfo_AttributesResponse.Size(m)
}
func (m *AttributesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_AttributesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_AttributesResponse proto.InternalMessageInfo
func (m *AttributesResponse) GetAttributes() []string {
if m != nil {
return m.Attributes
}
return nil
}
func (m *AttributesResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type LoadRequest struct {
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LoadRequest) Reset() { *m = LoadRequest{} }
func (m *LoadRequest) String() string { return proto.CompactTextString(m) }
func (*LoadRequest) ProtoMessage() {}
func (*LoadRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{1}
}
func (m *LoadRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LoadRequest.Unmarshal(m, b)
}
func (m *LoadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LoadRequest.Marshal(b, m, deterministic)
}
func (m *LoadRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_LoadRequest.Merge(m, src)
}
func (m *LoadRequest) XXX_Size() int {
return xxx_messageInfo_LoadRequest.Size(m)
}
func (m *LoadRequest) XXX_DiscardUnknown() {
xxx_messageInfo_LoadRequest.DiscardUnknown(m)
}
var xxx_messageInfo_LoadRequest proto.InternalMessageInfo
func (m *LoadRequest) GetData() string {
if m != nil {
return m.Data
}
return ""
}
type LoadResponse struct {
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LoadResponse) Reset() { *m = LoadResponse{} }
func (m *LoadResponse) String() string { return proto.CompactTextString(m) }
func (*LoadResponse) ProtoMessage() {}
func (*LoadResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{2}
}
func (m *LoadResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LoadResponse.Unmarshal(m, b)
}
func (m *LoadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LoadResponse.Marshal(b, m, deterministic)
}
func (m *LoadResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_LoadResponse.Merge(m, src)
}
func (m *LoadResponse) XXX_Size() int {
return xxx_messageInfo_LoadResponse.Size(m)
}
func (m *LoadResponse) XXX_DiscardUnknown() {
xxx_messageInfo_LoadResponse.DiscardUnknown(m)
}
var xxx_messageInfo_LoadResponse proto.InternalMessageInfo
func (m *LoadResponse) GetData() string {
if m != nil {
return m.Data
}
return ""
}
func (m *LoadResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type ValidateRequest struct {
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
Machine string `protobuf:"bytes,2,opt,name=machine,proto3" json:"machine,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidateRequest) Reset() { *m = ValidateRequest{} }
func (m *ValidateRequest) String() string { return proto.CompactTextString(m) }
func (*ValidateRequest) ProtoMessage() {}
func (*ValidateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{3}
}
func (m *ValidateRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidateRequest.Unmarshal(m, b)
}
func (m *ValidateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidateRequest.Marshal(b, m, deterministic)
}
func (m *ValidateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidateRequest.Merge(m, src)
}
func (m *ValidateRequest) XXX_Size() int {
return xxx_messageInfo_ValidateRequest.Size(m)
}
func (m *ValidateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ValidateRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ValidateRequest proto.InternalMessageInfo
func (m *ValidateRequest) GetData() string {
if m != nil {
return m.Data
}
return ""
}
func (m *ValidateRequest) GetMachine() string {
if m != nil {
return m.Machine
}
return ""
}
type ValidateResponse struct {
Errors []string `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ValidateResponse) Reset() { *m = ValidateResponse{} }
func (m *ValidateResponse) String() string { return proto.CompactTextString(m) }
func (*ValidateResponse) ProtoMessage() {}
func (*ValidateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{4}
}
func (m *ValidateResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValidateResponse.Unmarshal(m, b)
}
func (m *ValidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValidateResponse.Marshal(b, m, deterministic)
}
func (m *ValidateResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValidateResponse.Merge(m, src)
}
func (m *ValidateResponse) XXX_Size() int {
return xxx_messageInfo_ValidateResponse.Size(m)
}
func (m *ValidateResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ValidateResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ValidateResponse proto.InternalMessageInfo
func (m *ValidateResponse) GetErrors() []string {
if m != nil {
return m.Errors
}
return nil
}
func (m *ValidateResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type FinalizeRequest struct {
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FinalizeRequest) Reset() { *m = FinalizeRequest{} }
func (m *FinalizeRequest) String() string { return proto.CompactTextString(m) }
func (*FinalizeRequest) ProtoMessage() {}
func (*FinalizeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{5}
}
func (m *FinalizeRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FinalizeRequest.Unmarshal(m, b)
}
func (m *FinalizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FinalizeRequest.Marshal(b, m, deterministic)
}
func (m *FinalizeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_FinalizeRequest.Merge(m, src)
}
func (m *FinalizeRequest) XXX_Size() int {
return xxx_messageInfo_FinalizeRequest.Size(m)
}
func (m *FinalizeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_FinalizeRequest.DiscardUnknown(m)
}
var xxx_messageInfo_FinalizeRequest proto.InternalMessageInfo
func (m *FinalizeRequest) GetData() string {
if m != nil {
return m.Data
}
return ""
}
type FinalizeResponse struct {
Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FinalizeResponse) Reset() { *m = FinalizeResponse{} }
func (m *FinalizeResponse) String() string { return proto.CompactTextString(m) }
func (*FinalizeResponse) ProtoMessage() {}
func (*FinalizeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_952629f1a9a7438c, []int{6}
}
func (m *FinalizeResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FinalizeResponse.Unmarshal(m, b)
}
func (m *FinalizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FinalizeResponse.Marshal(b, m, deterministic)
}
func (m *FinalizeResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_FinalizeResponse.Merge(m, src)
}
func (m *FinalizeResponse) XXX_Size() int {
return xxx_messageInfo_FinalizeResponse.Size(m)
}
func (m *FinalizeResponse) XXX_DiscardUnknown() {
xxx_messageInfo_FinalizeResponse.DiscardUnknown(m)
}
var xxx_messageInfo_FinalizeResponse proto.InternalMessageInfo
func (m *FinalizeResponse) GetData() string {
if m != nil {
return m.Data
}
return ""
}
func (m *FinalizeResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func init() {
proto.RegisterType((*AttributesResponse)(nil), "vagrant.config.AttributesResponse")
proto.RegisterType((*LoadRequest)(nil), "vagrant.config.LoadRequest")
proto.RegisterType((*LoadResponse)(nil), "vagrant.config.LoadResponse")
proto.RegisterType((*ValidateRequest)(nil), "vagrant.config.ValidateRequest")
proto.RegisterType((*ValidateResponse)(nil), "vagrant.config.ValidateResponse")
proto.RegisterType((*FinalizeRequest)(nil), "vagrant.config.FinalizeRequest")
proto.RegisterType((*FinalizeResponse)(nil), "vagrant.config.FinalizeResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// ConfigClient is the client API for Config service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ConfigClient interface {
ConfigAttributes(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*AttributesResponse, error)
ConfigLoad(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error)
ConfigValidate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
ConfigFinalize(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*FinalizeResponse, error)
// These are IO helpers for streaming
Read(ctx context.Context, in *vagrant_io.ReadRequest, opts ...grpc.CallOption) (*vagrant_io.ReadResponse, error)
Write(ctx context.Context, in *vagrant_io.WriteRequest, opts ...grpc.CallOption) (*vagrant_io.WriteResponse, error)
}
type configClient struct {
cc *grpc.ClientConn
}
func NewConfigClient(cc *grpc.ClientConn) ConfigClient {
return &configClient{cc}
}
func (c *configClient) ConfigAttributes(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*AttributesResponse, error) {
out := new(AttributesResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/ConfigAttributes", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configClient) ConfigLoad(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) {
out := new(LoadResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/ConfigLoad", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configClient) ConfigValidate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error) {
out := new(ValidateResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/ConfigValidate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configClient) ConfigFinalize(ctx context.Context, in *FinalizeRequest, opts ...grpc.CallOption) (*FinalizeResponse, error) {
out := new(FinalizeResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/ConfigFinalize", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configClient) Read(ctx context.Context, in *vagrant_io.ReadRequest, opts ...grpc.CallOption) (*vagrant_io.ReadResponse, error) {
out := new(vagrant_io.ReadResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/Read", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configClient) Write(ctx context.Context, in *vagrant_io.WriteRequest, opts ...grpc.CallOption) (*vagrant_io.WriteResponse, error) {
out := new(vagrant_io.WriteResponse)
err := c.cc.Invoke(ctx, "/vagrant.config.Config/Write", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConfigServer is the server API for Config service.
type ConfigServer interface {
ConfigAttributes(context.Context, *vagrant_common.NullRequest) (*AttributesResponse, error)
ConfigLoad(context.Context, *LoadRequest) (*LoadResponse, error)
ConfigValidate(context.Context, *ValidateRequest) (*ValidateResponse, error)
ConfigFinalize(context.Context, *FinalizeRequest) (*FinalizeResponse, error)
// These are IO helpers for streaming
Read(context.Context, *vagrant_io.ReadRequest) (*vagrant_io.ReadResponse, error)
Write(context.Context, *vagrant_io.WriteRequest) (*vagrant_io.WriteResponse, error)
}
func RegisterConfigServer(s *grpc.Server, srv ConfigServer) {
s.RegisterService(&_Config_serviceDesc, srv)
}
func _Config_ConfigAttributes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.NullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).ConfigAttributes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/ConfigAttributes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).ConfigAttributes(ctx, req.(*vagrant_common.NullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Config_ConfigLoad_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).ConfigLoad(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/ConfigLoad",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).ConfigLoad(ctx, req.(*LoadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Config_ConfigValidate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ValidateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).ConfigValidate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/ConfigValidate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).ConfigValidate(ctx, req.(*ValidateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Config_ConfigFinalize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FinalizeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).ConfigFinalize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/ConfigFinalize",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).ConfigFinalize(ctx, req.(*FinalizeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Config_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_io.ReadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).Read(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/Read",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).Read(ctx, req.(*vagrant_io.ReadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Config_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_io.WriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServer).Write(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.config.Config/Write",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServer).Write(ctx, req.(*vagrant_io.WriteRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Config_serviceDesc = grpc.ServiceDesc{
ServiceName: "vagrant.config.Config",
HandlerType: (*ConfigServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ConfigAttributes",
Handler: _Config_ConfigAttributes_Handler,
},
{
MethodName: "ConfigLoad",
Handler: _Config_ConfigLoad_Handler,
},
{
MethodName: "ConfigValidate",
Handler: _Config_ConfigValidate_Handler,
},
{
MethodName: "ConfigFinalize",
Handler: _Config_ConfigFinalize_Handler,
},
{
MethodName: "Read",
Handler: _Config_Read_Handler,
},
{
MethodName: "Write",
Handler: _Config_Write_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vagrant_config/config.proto",
}
func init() { proto.RegisterFile("vagrant_config/config.proto", fileDescriptor_952629f1a9a7438c) }
var fileDescriptor_952629f1a9a7438c = []byte{
// 415 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xdf, 0x6b, 0xdb, 0x30,
0x10, 0xc7, 0xc9, 0xf2, 0x63, 0xe4, 0x36, 0x92, 0x20, 0xc6, 0xe6, 0x39, 0x63, 0xcb, 0x0c, 0x83,
0xbc, 0xcc, 0x82, 0xed, 0x65, 0x83, 0xc0, 0x56, 0x0a, 0x2d, 0x94, 0xd2, 0x07, 0x07, 0xda, 0x87,
0x3e, 0x14, 0xc5, 0x56, 0x6d, 0x81, 0x6d, 0xb9, 0xb2, 0x5c, 0x4a, 0xff, 0xc3, 0xfe, 0x57, 0x25,
0x92, 0x1c, 0x27, 0xb6, 0x13, 0x28, 0xf4, 0xc9, 0xba, 0xbb, 0xef, 0x7d, 0x4e, 0xba, 0x3b, 0xc3,
0xf4, 0x9e, 0x84, 0x82, 0xa4, 0xf2, 0xc6, 0xe7, 0xe9, 0x2d, 0x0b, 0xb1, 0xfe, 0xb8, 0x99, 0xe0,
0x92, 0xa3, 0x91, 0x09, 0xba, 0xda, 0x6b, 0x5f, 0x87, 0x4c, 0x46, 0xc5, 0xca, 0xf5, 0x79, 0x82,
0x23, 0x92, 0x47, 0xcc, 0xe7, 0x22, 0xc3, 0x46, 0x84, 0xe9, 0x83, 0xc4, 0x21, 0xff, 0x99, 0xc5,
0x45, 0xc8, 0xd2, 0x8d, 0xd7, 0x98, 0x0a, 0x88, 0xab, 0x62, 0x49, 0xc2, 0x53, 0xac, 0x3f, 0xba,
0x98, 0xbd, 0x7c, 0x2d, 0x38, 0xe3, 0x98, 0x71, 0x0d, 0x75, 0xce, 0x00, 0x1d, 0x49, 0x29, 0xd8,
0xaa, 0x90, 0x34, 0xf7, 0x68, 0x9e, 0xf1, 0x34, 0xa7, 0xe8, 0x2b, 0x00, 0xd9, 0x78, 0xad, 0xce,
0xac, 0x3b, 0x1f, 0x7a, 0x5b, 0x1e, 0xf4, 0x01, 0xfa, 0x54, 0x08, 0x2e, 0xac, 0x37, 0xb3, 0xce,
0x7c, 0xe8, 0x69, 0xc3, 0xf9, 0x0e, 0xef, 0xce, 0x39, 0x09, 0x3c, 0x7a, 0x57, 0xd0, 0x5c, 0x22,
0x04, 0xbd, 0x80, 0x48, 0x62, 0x75, 0x94, 0x46, 0x9d, 0x9d, 0x3f, 0xf0, 0x5e, 0x4b, 0x4c, 0xa1,
0x16, 0xcd, 0x1e, 0xf8, 0x3f, 0x18, 0x5f, 0x92, 0x98, 0x05, 0x44, 0xd2, 0x03, 0x05, 0x90, 0x05,
0x6f, 0x13, 0xe2, 0x47, 0x2c, 0xa5, 0x26, 0xbd, 0x34, 0x9d, 0xff, 0x30, 0xa9, 0x00, 0xa6, 0xfc,
0x47, 0x18, 0x28, 0x7a, 0xf9, 0x46, 0x63, 0xed, 0xb9, 0xc2, 0x0f, 0x18, 0x9f, 0xb0, 0x94, 0xc4,
0xec, 0xf1, 0xd0, 0x15, 0x9c, 0x05, 0x4c, 0x2a, 0xd9, 0x4b, 0xdf, 0xf9, 0xeb, 0xa9, 0x0b, 0x83,
0x63, 0xb5, 0x4d, 0x68, 0x09, 0x13, 0x7d, 0xaa, 0x26, 0x84, 0xa6, 0x6e, 0xb5, 0x72, 0x6a, 0x37,
0x2e, 0x8a, 0x38, 0x36, 0xb7, 0xb1, 0x1d, 0x77, 0x77, 0x1f, 0xdd, 0x96, 0xd1, 0x9e, 0x02, 0x68,
0xe8, 0x7a, 0x0e, 0x3b, 0x38, 0x95, 0xb1, 0x35, 0x40, 0xfb, 0x4b, 0x7b, 0xd0, 0x80, 0x96, 0x30,
0xd2, 0xa0, 0xb2, 0xab, 0xe8, 0x5b, 0x5d, 0x5f, 0x1b, 0x98, 0x3d, 0xdb, 0x2f, 0xa8, 0x43, 0xcb,
0x0e, 0x36, 0xa1, 0xb5, 0x11, 0x34, 0xa1, 0x8d, 0xe6, 0xff, 0x85, 0x9e, 0x47, 0x49, 0x80, 0x3e,
0x6d, 0x94, 0x8c, 0xbb, 0x6b, 0x4f, 0x89, 0xb0, 0x9a, 0x01, 0x93, 0xba, 0x80, 0xfe, 0x95, 0x60,
0x92, 0xa2, 0x1d, 0x89, 0x72, 0x95, 0xc9, 0x9f, 0x5b, 0x22, 0x3a, 0x7b, 0x35, 0x50, 0xff, 0xd8,
0xef, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x44, 0xad, 0xc6, 0x44, 0x04, 0x00, 0x00,
}

View File

@ -1,48 +0,0 @@
syntax = "proto3";
package vagrant.config;
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common/common.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io/io.proto";
message AttributesResponse {
repeated string attributes = 1;
string error = 2;
}
message LoadRequest {
string data = 1;
}
message LoadResponse {
string data = 1;
string error = 2;
}
message ValidateRequest {
string data = 1;
string machine = 2;
}
message ValidateResponse {
repeated string errors = 1;
string error = 2;
}
message FinalizeRequest {
string data = 1;
}
message FinalizeResponse {
string data = 1;
string error = 2;
}
service Config {
rpc ConfigAttributes(vagrant.common.NullRequest) returns (AttributesResponse);
rpc ConfigLoad(LoadRequest) returns (LoadResponse);
rpc ConfigValidate(ValidateRequest) returns (ValidateResponse);
rpc ConfigFinalize(FinalizeRequest) returns (FinalizeResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
}

View File

@ -1,688 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: vagrant_folder/synced_folder.proto
package vagrant_folder
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import vagrant_caps "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_caps"
import vagrant_common "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
import vagrant_io "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Request struct {
Machine string `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"`
Folders string `protobuf:"bytes,2,opt,name=folders,proto3" json:"folders,omitempty"`
Options string `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) {
return fileDescriptor_8a01e482b349ecb1, []int{0}
}
func (m *Request) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Request.Unmarshal(m, b)
}
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Request.Marshal(b, m, deterministic)
}
func (m *Request) XXX_Merge(src proto.Message) {
xxx_messageInfo_Request.Merge(m, src)
}
func (m *Request) XXX_Size() int {
return xxx_messageInfo_Request.Size(m)
}
func (m *Request) XXX_DiscardUnknown() {
xxx_messageInfo_Request.DiscardUnknown(m)
}
var xxx_messageInfo_Request proto.InternalMessageInfo
func (m *Request) GetMachine() string {
if m != nil {
return m.Machine
}
return ""
}
func (m *Request) GetFolders() string {
if m != nil {
return m.Folders
}
return ""
}
func (m *Request) GetOptions() string {
if m != nil {
return m.Options
}
return ""
}
type CleanupRequest struct {
Machine string `protobuf:"bytes,1,opt,name=machine,proto3" json:"machine,omitempty"`
Options string `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CleanupRequest) Reset() { *m = CleanupRequest{} }
func (m *CleanupRequest) String() string { return proto.CompactTextString(m) }
func (*CleanupRequest) ProtoMessage() {}
func (*CleanupRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_8a01e482b349ecb1, []int{1}
}
func (m *CleanupRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CleanupRequest.Unmarshal(m, b)
}
func (m *CleanupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CleanupRequest.Marshal(b, m, deterministic)
}
func (m *CleanupRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CleanupRequest.Merge(m, src)
}
func (m *CleanupRequest) XXX_Size() int {
return xxx_messageInfo_CleanupRequest.Size(m)
}
func (m *CleanupRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CleanupRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CleanupRequest proto.InternalMessageInfo
func (m *CleanupRequest) GetMachine() string {
if m != nil {
return m.Machine
}
return ""
}
func (m *CleanupRequest) GetOptions() string {
if m != nil {
return m.Options
}
return ""
}
type InfoResponse struct {
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
Priority int64 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *InfoResponse) Reset() { *m = InfoResponse{} }
func (m *InfoResponse) String() string { return proto.CompactTextString(m) }
func (*InfoResponse) ProtoMessage() {}
func (*InfoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_8a01e482b349ecb1, []int{2}
}
func (m *InfoResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InfoResponse.Unmarshal(m, b)
}
func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic)
}
func (m *InfoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_InfoResponse.Merge(m, src)
}
func (m *InfoResponse) XXX_Size() int {
return xxx_messageInfo_InfoResponse.Size(m)
}
func (m *InfoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_InfoResponse.DiscardUnknown(m)
}
var xxx_messageInfo_InfoResponse proto.InternalMessageInfo
func (m *InfoResponse) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *InfoResponse) GetPriority() int64 {
if m != nil {
return m.Priority
}
return 0
}
func init() {
proto.RegisterType((*Request)(nil), "vagrant.folder.Request")
proto.RegisterType((*CleanupRequest)(nil), "vagrant.folder.CleanupRequest")
proto.RegisterType((*InfoResponse)(nil), "vagrant.folder.InfoResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// SyncedFolderClient is the client API for SyncedFolder service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SyncedFolderClient interface {
Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error)
Disable(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error)
Enable(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error)
Info(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*InfoResponse, error)
IsUsable(ctx context.Context, in *vagrant_common.EmptyRequest, opts ...grpc.CallOption) (*vagrant_common.IsResponse, error)
Name(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_common.NameResponse, error)
Prepare(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error)
// These are IO helpers for streaming
Read(ctx context.Context, in *vagrant_io.ReadRequest, opts ...grpc.CallOption) (*vagrant_io.ReadResponse, error)
Write(ctx context.Context, in *vagrant_io.WriteRequest, opts ...grpc.CallOption) (*vagrant_io.WriteResponse, error)
// Capabilities
GuestCapabilities(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_caps.CapabilitiesResponse, error)
GuestCapability(ctx context.Context, in *vagrant_caps.GuestCapabilityRequest, opts ...grpc.CallOption) (*vagrant_caps.GuestCapabilityResponse, error)
HostCapabilities(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_caps.CapabilitiesResponse, error)
HostCapability(ctx context.Context, in *vagrant_caps.HostCapabilityRequest, opts ...grpc.CallOption) (*vagrant_caps.HostCapabilityResponse, error)
}
type syncedFolderClient struct {
cc *grpc.ClientConn
}
func NewSyncedFolderClient(cc *grpc.ClientConn) SyncedFolderClient {
return &syncedFolderClient{cc}
}
func (c *syncedFolderClient) Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error) {
out := new(vagrant_common.EmptyResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Cleanup", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Disable(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error) {
out := new(vagrant_common.EmptyResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Disable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Enable(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error) {
out := new(vagrant_common.EmptyResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Enable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Info(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
out := new(InfoResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Info", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) IsUsable(ctx context.Context, in *vagrant_common.EmptyRequest, opts ...grpc.CallOption) (*vagrant_common.IsResponse, error) {
out := new(vagrant_common.IsResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/IsUsable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Name(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_common.NameResponse, error) {
out := new(vagrant_common.NameResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Name", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Prepare(ctx context.Context, in *Request, opts ...grpc.CallOption) (*vagrant_common.EmptyResponse, error) {
out := new(vagrant_common.EmptyResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Prepare", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Read(ctx context.Context, in *vagrant_io.ReadRequest, opts ...grpc.CallOption) (*vagrant_io.ReadResponse, error) {
out := new(vagrant_io.ReadResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Read", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) Write(ctx context.Context, in *vagrant_io.WriteRequest, opts ...grpc.CallOption) (*vagrant_io.WriteResponse, error) {
out := new(vagrant_io.WriteResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/Write", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) GuestCapabilities(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_caps.CapabilitiesResponse, error) {
out := new(vagrant_caps.CapabilitiesResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/GuestCapabilities", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) GuestCapability(ctx context.Context, in *vagrant_caps.GuestCapabilityRequest, opts ...grpc.CallOption) (*vagrant_caps.GuestCapabilityResponse, error) {
out := new(vagrant_caps.GuestCapabilityResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/GuestCapability", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) HostCapabilities(ctx context.Context, in *vagrant_common.NullRequest, opts ...grpc.CallOption) (*vagrant_caps.CapabilitiesResponse, error) {
out := new(vagrant_caps.CapabilitiesResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/HostCapabilities", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *syncedFolderClient) HostCapability(ctx context.Context, in *vagrant_caps.HostCapabilityRequest, opts ...grpc.CallOption) (*vagrant_caps.HostCapabilityResponse, error) {
out := new(vagrant_caps.HostCapabilityResponse)
err := c.cc.Invoke(ctx, "/vagrant.folder.SyncedFolder/HostCapability", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SyncedFolderServer is the server API for SyncedFolder service.
type SyncedFolderServer interface {
Cleanup(context.Context, *CleanupRequest) (*vagrant_common.EmptyResponse, error)
Disable(context.Context, *Request) (*vagrant_common.EmptyResponse, error)
Enable(context.Context, *Request) (*vagrant_common.EmptyResponse, error)
Info(context.Context, *vagrant_common.NullRequest) (*InfoResponse, error)
IsUsable(context.Context, *vagrant_common.EmptyRequest) (*vagrant_common.IsResponse, error)
Name(context.Context, *vagrant_common.NullRequest) (*vagrant_common.NameResponse, error)
Prepare(context.Context, *Request) (*vagrant_common.EmptyResponse, error)
// These are IO helpers for streaming
Read(context.Context, *vagrant_io.ReadRequest) (*vagrant_io.ReadResponse, error)
Write(context.Context, *vagrant_io.WriteRequest) (*vagrant_io.WriteResponse, error)
// Capabilities
GuestCapabilities(context.Context, *vagrant_common.NullRequest) (*vagrant_caps.CapabilitiesResponse, error)
GuestCapability(context.Context, *vagrant_caps.GuestCapabilityRequest) (*vagrant_caps.GuestCapabilityResponse, error)
HostCapabilities(context.Context, *vagrant_common.NullRequest) (*vagrant_caps.CapabilitiesResponse, error)
HostCapability(context.Context, *vagrant_caps.HostCapabilityRequest) (*vagrant_caps.HostCapabilityResponse, error)
}
func RegisterSyncedFolderServer(s *grpc.Server, srv SyncedFolderServer) {
s.RegisterService(&_SyncedFolder_serviceDesc, srv)
}
func _SyncedFolder_Cleanup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CleanupRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Cleanup(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Cleanup",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Cleanup(ctx, req.(*CleanupRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Disable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Disable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Disable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Disable(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Enable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Enable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Enable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Enable(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.NullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Info(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Info",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Info(ctx, req.(*vagrant_common.NullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_IsUsable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.EmptyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).IsUsable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/IsUsable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).IsUsable(ctx, req.(*vagrant_common.EmptyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Name_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.NullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Name(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Name",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Name(ctx, req.(*vagrant_common.NullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Request)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Prepare(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Prepare",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Prepare(ctx, req.(*Request))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_io.ReadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Read(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Read",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Read(ctx, req.(*vagrant_io.ReadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_io.WriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).Write(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/Write",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).Write(ctx, req.(*vagrant_io.WriteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_GuestCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.NullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).GuestCapabilities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/GuestCapabilities",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).GuestCapabilities(ctx, req.(*vagrant_common.NullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_GuestCapability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_caps.GuestCapabilityRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).GuestCapability(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/GuestCapability",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).GuestCapability(ctx, req.(*vagrant_caps.GuestCapabilityRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_HostCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_common.NullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).HostCapabilities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/HostCapabilities",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).HostCapabilities(ctx, req.(*vagrant_common.NullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SyncedFolder_HostCapability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(vagrant_caps.HostCapabilityRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SyncedFolderServer).HostCapability(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.folder.SyncedFolder/HostCapability",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SyncedFolderServer).HostCapability(ctx, req.(*vagrant_caps.HostCapabilityRequest))
}
return interceptor(ctx, in, info, handler)
}
var _SyncedFolder_serviceDesc = grpc.ServiceDesc{
ServiceName: "vagrant.folder.SyncedFolder",
HandlerType: (*SyncedFolderServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Cleanup",
Handler: _SyncedFolder_Cleanup_Handler,
},
{
MethodName: "Disable",
Handler: _SyncedFolder_Disable_Handler,
},
{
MethodName: "Enable",
Handler: _SyncedFolder_Enable_Handler,
},
{
MethodName: "Info",
Handler: _SyncedFolder_Info_Handler,
},
{
MethodName: "IsUsable",
Handler: _SyncedFolder_IsUsable_Handler,
},
{
MethodName: "Name",
Handler: _SyncedFolder_Name_Handler,
},
{
MethodName: "Prepare",
Handler: _SyncedFolder_Prepare_Handler,
},
{
MethodName: "Read",
Handler: _SyncedFolder_Read_Handler,
},
{
MethodName: "Write",
Handler: _SyncedFolder_Write_Handler,
},
{
MethodName: "GuestCapabilities",
Handler: _SyncedFolder_GuestCapabilities_Handler,
},
{
MethodName: "GuestCapability",
Handler: _SyncedFolder_GuestCapability_Handler,
},
{
MethodName: "HostCapabilities",
Handler: _SyncedFolder_HostCapabilities_Handler,
},
{
MethodName: "HostCapability",
Handler: _SyncedFolder_HostCapability_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vagrant_folder/synced_folder.proto",
}
func init() { proto.RegisterFile("vagrant_folder/synced_folder.proto", fileDescriptor_8a01e482b349ecb1) }
var fileDescriptor_8a01e482b349ecb1 = []byte{
// 488 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x5f, 0x6f, 0xd3, 0x30,
0x14, 0xc5, 0xb5, 0x3f, 0x2c, 0xe3, 0x32, 0x15, 0xf0, 0x0b, 0x21, 0x0c, 0x34, 0x95, 0x21, 0xf1,
0x42, 0x22, 0xc1, 0x13, 0x12, 0x0f, 0x4c, 0xeb, 0x60, 0x95, 0xd0, 0x84, 0x52, 0xd0, 0x1e, 0x26,
0x51, 0xb9, 0xa9, 0xd7, 0x5a, 0x4a, 0x6c, 0x63, 0x3b, 0x88, 0x7c, 0x48, 0xbe, 0x13, 0x4a, 0x6c,
0x87, 0x38, 0x40, 0xa9, 0x58, 0x9f, 0xaa, 0x7b, 0xcf, 0x3d, 0x3f, 0x9f, 0xde, 0x38, 0x81, 0xe1,
0x37, 0xbc, 0x90, 0x98, 0xe9, 0xe9, 0x35, 0xcf, 0xe7, 0x44, 0x26, 0xaa, 0x62, 0x19, 0x99, 0xdb,
0x2a, 0x16, 0x92, 0x6b, 0x8e, 0x06, 0x76, 0x26, 0x36, 0xdd, 0xe8, 0x6a, 0x41, 0xf5, 0xb2, 0x9c,
0xc5, 0x19, 0x2f, 0x92, 0x25, 0x56, 0x4b, 0x9a, 0x71, 0x29, 0x12, 0x3b, 0x94, 0x90, 0xef, 0x3a,
0x59, 0xf0, 0x17, 0x22, 0x2f, 0x17, 0x94, 0xb5, 0x5d, 0x5b, 0x36, 0x40, 0xd7, 0x9c, 0x66, 0xbc,
0x28, 0x38, 0x4b, 0xcc, 0x8f, 0x39, 0x2c, 0x9a, 0x6c, 0x0a, 0x4e, 0x79, 0x42, 0xb9, 0x85, 0x4e,
0x37, 0x96, 0x18, 0x0b, 0x95, 0x64, 0x58, 0xe0, 0x19, 0xcd, 0xa9, 0xa6, 0x44, 0x99, 0x03, 0x86,
0x97, 0x10, 0xa4, 0xe4, 0x6b, 0x49, 0x94, 0x46, 0x21, 0x04, 0x05, 0xce, 0x96, 0x94, 0x91, 0x70,
0xeb, 0x68, 0xeb, 0xf9, 0xed, 0xd4, 0x95, 0xb5, 0x62, 0x36, 0xa8, 0xc2, 0x6d, 0xa3, 0xd8, 0xb2,
0x56, 0xb8, 0xd0, 0x94, 0x33, 0x15, 0xee, 0x18, 0xc5, 0x96, 0xc3, 0x11, 0x0c, 0x4e, 0x73, 0x82,
0x59, 0x29, 0xd6, 0xe2, 0x3b, 0xca, 0xb6, 0x4f, 0xf9, 0x00, 0x07, 0x63, 0x76, 0xcd, 0x53, 0xa2,
0x04, 0x67, 0x8a, 0xa0, 0x23, 0xb8, 0x33, 0x27, 0x2a, 0x93, 0xb4, 0xd1, 0x2d, 0xa7, 0xdb, 0x42,
0x11, 0xec, 0x0b, 0x49, 0xb9, 0xa4, 0xba, 0x6a, 0x60, 0x3b, 0x69, 0x5b, 0xbf, 0xfc, 0x11, 0xc0,
0xc1, 0xa4, 0xb9, 0x27, 0xef, 0x9a, 0xfc, 0xe8, 0x1c, 0x02, 0x1b, 0x12, 0x3d, 0x89, 0xfd, 0xcb,
0x12, 0xfb, 0xe9, 0xa3, 0xc7, 0xad, 0x6e, 0x9f, 0xfa, 0x59, 0x21, 0x74, 0xd5, 0x06, 0x3b, 0x81,
0x60, 0x44, 0x15, 0x9e, 0xe5, 0x04, 0x3d, 0xe8, 0x93, 0xd6, 0x44, 0xbc, 0x85, 0xbd, 0x33, 0x76,
0x23, 0xc2, 0x09, 0xec, 0xd6, 0xdb, 0x42, 0x8f, 0xfa, 0x63, 0x17, 0x65, 0x9e, 0x3b, 0xc6, 0x61,
0x1f, 0xee, 0x2d, 0x78, 0x04, 0xfb, 0x63, 0xf5, 0xd9, 0xfc, 0x91, 0xc3, 0xbf, 0x9c, 0x66, 0x38,
0x51, 0x5f, 0x1d, 0xab, 0x6e, 0x90, 0x0b, 0x5c, 0x90, 0x75, 0x83, 0x38, 0x11, 0x17, 0xa4, 0xbb,
0xd0, 0x8f, 0x92, 0x08, 0x2c, 0xff, 0x7f, 0x1d, 0xaf, 0x61, 0x37, 0x25, 0x78, 0xde, 0xf1, 0x53,
0x1e, 0xd7, 0x1d, 0xe7, 0x0f, 0x7f, 0x17, 0xac, 0xf5, 0x0d, 0xdc, 0xba, 0x94, 0x54, 0x13, 0xe4,
0x8d, 0x34, 0x2d, 0x67, 0x7e, 0xf8, 0x07, 0xc5, 0xba, 0x3f, 0xc1, 0xfd, 0xf7, 0xf5, 0xcc, 0x69,
0xe7, 0x7d, 0x5b, 0xbd, 0x8b, 0xe1, 0x2f, 0x11, 0x0b, 0x15, 0x77, 0x8d, 0x2d, 0xf5, 0x0b, 0xdc,
0xf5, 0xa9, 0x15, 0x3a, 0xf6, 0x6d, 0x3d, 0xd9, 0xc1, 0x9f, 0xfd, 0x63, 0xca, 0xf2, 0x27, 0x70,
0xef, 0x9c, 0x6f, 0x3a, 0xf4, 0x15, 0x0c, 0x3c, 0x68, 0x85, 0x9e, 0xfa, 0x2e, 0x5f, 0x75, 0xe8,
0xe3, 0xd5, 0x43, 0x06, 0x3e, 0xdb, 0x6b, 0xbe, 0x61, 0xaf, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff,
0x89, 0x36, 0xb1, 0x5c, 0x0c, 0x06, 0x00, 0x00,
}

View File

@ -1,40 +0,0 @@
syntax = "proto3";
package vagrant.folder;
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common/common.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io/io.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_caps/capabilities.proto";
message Request {
string machine = 1;
string folders = 2;
string options = 3;
}
message CleanupRequest {
string machine = 1;
string options = 2;
}
message InfoResponse {
string description = 1;
int64 priority = 2;
}
service SyncedFolder {
rpc Cleanup(CleanupRequest) returns (vagrant.common.EmptyResponse);
rpc Disable(Request) returns (vagrant.common.EmptyResponse);
rpc Enable(Request) returns (vagrant.common.EmptyResponse);
rpc Info(vagrant.common.NullRequest) returns (InfoResponse);
rpc IsUsable(vagrant.common.EmptyRequest) returns (vagrant.common.IsResponse);
rpc Name(vagrant.common.NullRequest) returns (vagrant.common.NameResponse);
rpc Prepare(Request) returns (vagrant.common.EmptyResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
// Capabilities
rpc GuestCapabilities(vagrant.common.NullRequest) returns (vagrant.caps.CapabilitiesResponse);
rpc GuestCapability(vagrant.caps.GuestCapabilityRequest) returns (vagrant.caps.GuestCapabilityResponse);
rpc HostCapabilities(vagrant.common.NullRequest) returns (vagrant.caps.CapabilitiesResponse);
rpc HostCapability(vagrant.caps.HostCapabilityRequest) returns (vagrant.caps.HostCapabilityResponse);
}

View File

@ -1,332 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: vagrant_io/io.proto
package vagrant_io
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ReadRequest struct {
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReadRequest) Reset() { *m = ReadRequest{} }
func (m *ReadRequest) String() string { return proto.CompactTextString(m) }
func (*ReadRequest) ProtoMessage() {}
func (*ReadRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_d46affeac7affd9e, []int{0}
}
func (m *ReadRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReadRequest.Unmarshal(m, b)
}
func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic)
}
func (m *ReadRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReadRequest.Merge(m, src)
}
func (m *ReadRequest) XXX_Size() int {
return xxx_messageInfo_ReadRequest.Size(m)
}
func (m *ReadRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ReadRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ReadRequest proto.InternalMessageInfo
func (m *ReadRequest) GetTarget() string {
if m != nil {
return m.Target
}
return ""
}
type ReadResponse struct {
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReadResponse) Reset() { *m = ReadResponse{} }
func (m *ReadResponse) String() string { return proto.CompactTextString(m) }
func (*ReadResponse) ProtoMessage() {}
func (*ReadResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_d46affeac7affd9e, []int{1}
}
func (m *ReadResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReadResponse.Unmarshal(m, b)
}
func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic)
}
func (m *ReadResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReadResponse.Merge(m, src)
}
func (m *ReadResponse) XXX_Size() int {
return xxx_messageInfo_ReadResponse.Size(m)
}
func (m *ReadResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ReadResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ReadResponse proto.InternalMessageInfo
func (m *ReadResponse) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *ReadResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
type WriteRequest struct {
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WriteRequest) Reset() { *m = WriteRequest{} }
func (m *WriteRequest) String() string { return proto.CompactTextString(m) }
func (*WriteRequest) ProtoMessage() {}
func (*WriteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_d46affeac7affd9e, []int{2}
}
func (m *WriteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WriteRequest.Unmarshal(m, b)
}
func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic)
}
func (m *WriteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_WriteRequest.Merge(m, src)
}
func (m *WriteRequest) XXX_Size() int {
return xxx_messageInfo_WriteRequest.Size(m)
}
func (m *WriteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_WriteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_WriteRequest proto.InternalMessageInfo
func (m *WriteRequest) GetContent() string {
if m != nil {
return m.Content
}
return ""
}
func (m *WriteRequest) GetTarget() string {
if m != nil {
return m.Target
}
return ""
}
type WriteResponse struct {
Length int32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WriteResponse) Reset() { *m = WriteResponse{} }
func (m *WriteResponse) String() string { return proto.CompactTextString(m) }
func (*WriteResponse) ProtoMessage() {}
func (*WriteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_d46affeac7affd9e, []int{3}
}
func (m *WriteResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WriteResponse.Unmarshal(m, b)
}
func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic)
}
func (m *WriteResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_WriteResponse.Merge(m, src)
}
func (m *WriteResponse) XXX_Size() int {
return xxx_messageInfo_WriteResponse.Size(m)
}
func (m *WriteResponse) XXX_DiscardUnknown() {
xxx_messageInfo_WriteResponse.DiscardUnknown(m)
}
var xxx_messageInfo_WriteResponse proto.InternalMessageInfo
func (m *WriteResponse) GetLength() int32 {
if m != nil {
return m.Length
}
return 0
}
func (m *WriteResponse) GetError() string {
if m != nil {
return m.Error
}
return ""
}
func init() {
proto.RegisterType((*ReadRequest)(nil), "vagrant.io.ReadRequest")
proto.RegisterType((*ReadResponse)(nil), "vagrant.io.ReadResponse")
proto.RegisterType((*WriteRequest)(nil), "vagrant.io.WriteRequest")
proto.RegisterType((*WriteResponse)(nil), "vagrant.io.WriteResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// IOClient is the client API for IO service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type IOClient interface {
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
}
type iOClient struct {
cc *grpc.ClientConn
}
func NewIOClient(cc *grpc.ClientConn) IOClient {
return &iOClient{cc}
}
func (c *iOClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
out := new(ReadResponse)
err := c.cc.Invoke(ctx, "/vagrant.io.IO/Read", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iOClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) {
out := new(WriteResponse)
err := c.cc.Invoke(ctx, "/vagrant.io.IO/Write", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// IOServer is the server API for IO service.
type IOServer interface {
Read(context.Context, *ReadRequest) (*ReadResponse, error)
Write(context.Context, *WriteRequest) (*WriteResponse, error)
}
func RegisterIOServer(s *grpc.Server, srv IOServer) {
s.RegisterService(&_IO_serviceDesc, srv)
}
func _IO_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IOServer).Read(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.io.IO/Read",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IOServer).Read(ctx, req.(*ReadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IO_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IOServer).Write(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/vagrant.io.IO/Write",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IOServer).Write(ctx, req.(*WriteRequest))
}
return interceptor(ctx, in, info, handler)
}
var _IO_serviceDesc = grpc.ServiceDesc{
ServiceName: "vagrant.io.IO",
HandlerType: (*IOServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Read",
Handler: _IO_Read_Handler,
},
{
MethodName: "Write",
Handler: _IO_Write_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vagrant_io/io.proto",
}
func init() { proto.RegisterFile("vagrant_io/io.proto", fileDescriptor_d46affeac7affd9e) }
var fileDescriptor_d46affeac7affd9e = []byte{
// 219 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x4b, 0x4c, 0x2f,
0x4a, 0xcc, 0x2b, 0x89, 0xcf, 0xcc, 0xd7, 0xcf, 0xcc, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x82, 0x0a, 0xea, 0x65, 0xe6, 0x2b, 0xa9, 0x72, 0x71, 0x07, 0xa5, 0x26, 0xa6, 0x04, 0xa5,
0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x89, 0x71, 0xb1, 0x95, 0x24, 0x16, 0xa5, 0xa7, 0x96, 0x48,
0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x79, 0x4a, 0x76, 0x5c, 0x3c, 0x10, 0x65, 0xc5, 0x05,
0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x12, 0x5c, 0xec, 0xc9, 0xf9, 0x79, 0x25, 0xa9, 0x79, 0x30, 0x85,
0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x6a, 0x51, 0x51, 0x7e, 0x91, 0x04, 0x13, 0x58, 0x1c, 0xc2,
0x51, 0x72, 0xe0, 0xe2, 0x09, 0x2f, 0xca, 0x2c, 0x49, 0x85, 0xd9, 0x83, 0x5b, 0x3f, 0xc2, 0x05,
0x4c, 0x28, 0x2e, 0xb0, 0xe5, 0xe2, 0x85, 0x9a, 0x00, 0x75, 0x82, 0x18, 0x17, 0x5b, 0x4e, 0x6a,
0x5e, 0x7a, 0x49, 0x06, 0xd8, 0x04, 0xd6, 0x20, 0x28, 0x0f, 0xbb, 0x03, 0x8c, 0x6a, 0xb9, 0x98,
0x3c, 0xfd, 0x85, 0x2c, 0xb9, 0x58, 0x40, 0xde, 0x10, 0x12, 0xd7, 0x43, 0x04, 0x81, 0x1e, 0x92,
0xff, 0xa5, 0x24, 0x30, 0x25, 0xa0, 0xd6, 0xd9, 0x70, 0xb1, 0x82, 0xed, 0x17, 0x42, 0x51, 0x82,
0xec, 0x29, 0x29, 0x49, 0x2c, 0x32, 0x10, 0xdd, 0x49, 0x6c, 0xe0, 0x90, 0x37, 0x06, 0x04, 0x00,
0x00, 0xff, 0xff, 0x47, 0x7e, 0x0b, 0xe4, 0x90, 0x01, 0x00, 0x00,
}

View File

@ -1,26 +0,0 @@
syntax = "proto3";
package vagrant.io;
message ReadRequest {
string target = 1;
}
message ReadResponse {
string content = 1;
string error = 2;
}
message WriteRequest {
string content = 1;
string target = 2;
}
message WriteResponse {
int32 length = 1;
string error = 2;
}
service IO {
rpc Read(ReadRequest) returns (ReadResponse);
rpc Write(WriteRequest) returns (WriteResponse);
}

View File

@ -1,74 +0,0 @@
syntax = "proto3";
package vagrant.provider;
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_caps/capabilities.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common/common.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_config/config.proto";
import "github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_io/io.proto";
message ActionRequest {
string name = 1;
string machine = 2;
}
message ActionResponse {
repeated string result = 1;
string error = 2;
}
message InfoResponse {
repeated string capabilities = 1;
string description = 2;
int64 priority = 3;
}
message RunActionRequest {
string name = 1;
string data = 2;
string machine = 3;
}
message RunActionResponse {
string data = 1;
string error = 2;
}
message SshInfoResponse {
string host = 1;
int64 port = 2;
string private_key_path = 3;
string username = 4;
string error = 5;
}
message StateResponse {
string id = 1;
string short_description = 2;
string long_description = 3;
string error = 4;
}
service Provider {
rpc Action(ActionRequest) returns (ActionResponse);
rpc Info(vagrant.common.NullRequest) returns (InfoResponse);
rpc IsInstalled(vagrant.common.EmptyRequest) returns (vagrant.common.IsResponse);
rpc IsUsable(vagrant.common.EmptyRequest) returns (vagrant.common.IsResponse);
rpc MachineIdChanged(vagrant.common.EmptyRequest) returns (vagrant.common.EmptyResponse);
rpc Name(vagrant.common.NullRequest) returns (vagrant.common.NameResponse);
rpc RunAction(RunActionRequest) returns (RunActionResponse);
rpc SshInfo(vagrant.common.EmptyRequest) returns (SshInfoResponse);
rpc State(vagrant.common.EmptyRequest) returns (StateResponse);
// These are IO helpers for streaming
rpc Read(vagrant.io.ReadRequest) returns (vagrant.io.ReadResponse);
rpc Write(vagrant.io.WriteRequest) returns (vagrant.io.WriteResponse);
// These are Config helpers
rpc ConfigAttributes(vagrant.common.NullRequest) returns (vagrant.config.AttributesResponse);
rpc ConfigLoad(vagrant.config.LoadRequest) returns (vagrant.config.LoadResponse);
rpc ConfigValidate(vagrant.config.ValidateRequest) returns (vagrant.config.ValidateResponse);
rpc ConfigFinalize(vagrant.config.FinalizeRequest) returns (vagrant.config.FinalizeResponse);
// Capabilities
rpc GuestCapabilities(vagrant.common.NullRequest) returns (vagrant.caps.CapabilitiesResponse);
rpc GuestCapability(vagrant.caps.GuestCapabilityRequest) returns (vagrant.caps.GuestCapabilityResponse);
rpc HostCapabilities(vagrant.common.NullRequest) returns (vagrant.caps.CapabilitiesResponse);
rpc HostCapability(vagrant.caps.HostCapabilityRequest) returns (vagrant.caps.HostCapabilityResponse);
rpc ProviderCapabilities(vagrant.common.NullRequest) returns (vagrant.caps.ProviderCapabilitiesResponse);
rpc ProviderCapability(vagrant.caps.ProviderCapabilityRequest) returns (vagrant.caps.ProviderCapabilityResponse);
}

View File

@ -8,8 +8,7 @@ import (
go_plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_provider"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto"
"github.com/LK4D4/joincontext"
)
@ -31,7 +30,7 @@ type GRPCProviderClient struct {
GRPCHostCapabilitiesClient
GRPCProviderCapabilitiesClient
GRPCIOClient
client vagrant_provider.ProviderClient
client vagrant_proto.ProviderClient
doneCtx context.Context
}
@ -42,20 +41,20 @@ func (c *GRPCProviderClient) Action(ctx context.Context, actionName string, m *v
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.Action(jctx, &vagrant_provider.ActionRequest{
resp, err := c.client.Action(jctx, &vagrant_proto.GenericAction{
Name: actionName,
Machine: machData})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
r = resp.Result
r = resp.Items
return
}
func (c *GRPCProviderClient) Info() *vagrant.ProviderInfo {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.Info(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.Info(jctx, &vagrant_proto.Empty{})
if err != nil {
return &vagrant.ProviderInfo{}
}
@ -70,7 +69,7 @@ func (c *GRPCProviderClient) IsInstalled(ctx context.Context, m *vagrant.Machine
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.IsInstalled(jctx, &vagrant_common.EmptyRequest{
resp, err := c.client.IsInstalled(jctx, &vagrant_proto.Machine{
Machine: machData})
if err != nil {
return false, handleGrpcError(err, c.doneCtx, ctx)
@ -85,7 +84,7 @@ func (c *GRPCProviderClient) IsUsable(ctx context.Context, m *vagrant.Machine) (
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.IsUsable(jctx, &vagrant_common.EmptyRequest{
resp, err := c.client.IsUsable(jctx, &vagrant_proto.Machine{
Machine: machData})
if err != nil {
return false, handleGrpcError(err, c.doneCtx, ctx)
@ -100,7 +99,7 @@ func (c *GRPCProviderClient) MachineIdChanged(ctx context.Context, m *vagrant.Ma
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
_, err = c.client.MachineIdChanged(jctx, &vagrant_common.EmptyRequest{
_, err = c.client.MachineIdChanged(jctx, &vagrant_proto.Machine{
Machine: machData})
if err != nil {
return handleGrpcError(err, c.doneCtx, ctx)
@ -118,14 +117,14 @@ func (c *GRPCProviderClient) RunAction(ctx context.Context, actName string, args
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.RunAction(jctx, &vagrant_provider.RunActionRequest{
resp, err := c.client.RunAction(jctx, &vagrant_proto.ExecuteAction{
Name: actName,
Data: string(runData),
Machine: machData})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
}
err = json.Unmarshal([]byte(resp.Data), &r)
err = json.Unmarshal([]byte(resp.Result), &r)
if err != nil {
return
}
@ -138,7 +137,7 @@ func (c *GRPCProviderClient) SshInfo(ctx context.Context, m *vagrant.Machine) (r
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.SshInfo(jctx, &vagrant_common.EmptyRequest{
resp, err := c.client.SshInfo(jctx, &vagrant_proto.Machine{
Machine: machData})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
@ -157,7 +156,7 @@ func (c *GRPCProviderClient) State(ctx context.Context, m *vagrant.Machine) (r *
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.State(jctx, &vagrant_common.EmptyRequest{
resp, err := c.client.State(jctx, &vagrant_proto.Machine{
Machine: machData})
if err != nil {
return nil, handleGrpcError(err, c.doneCtx, ctx)
@ -172,7 +171,7 @@ func (c *GRPCProviderClient) State(ctx context.Context, m *vagrant.Machine) (r *
func (c *GRPCProviderClient) Name() string {
ctx := context.Background()
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.Name(jctx, &vagrant_common.NullRequest{})
resp, err := c.client.Name(jctx, &vagrant_proto.Empty{})
if err != nil {
return ""
}
@ -180,7 +179,7 @@ func (c *GRPCProviderClient) Name() string {
}
func (p *ProviderPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
client := vagrant_provider.NewProviderClient(c)
client := vagrant_proto.NewProviderClient(c)
return &GRPCProviderClient{
GRPCConfigClient: GRPCConfigClient{
client: client,
@ -204,7 +203,7 @@ func (p *ProviderPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCB
func (p *ProviderPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
p.Impl.Init()
vagrant_provider.RegisterProviderServer(s, &GRPCProviderServer{
vagrant_proto.RegisterProviderServer(s, &GRPCProviderServer{
Impl: p.Impl,
GRPCConfigServer: GRPCConfigServer{
Impl: p.Impl},
@ -228,10 +227,10 @@ type GRPCProviderServer struct {
Impl Provider
}
func (s *GRPCProviderServer) Action(ctx context.Context, req *vagrant_provider.ActionRequest) (resp *vagrant_provider.ActionResponse, err error) {
resp = &vagrant_provider.ActionResponse{}
func (s *GRPCProviderServer) Action(ctx context.Context, req *vagrant_proto.GenericAction) (resp *vagrant_proto.ListResponse, err error) {
resp = &vagrant_proto.ListResponse{}
var r []string
n := make(chan struct{}, 1)
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -249,14 +248,14 @@ func (s *GRPCProviderServer) Action(ctx context.Context, req *vagrant_provider.A
if err != nil {
return
}
resp.Result = r
resp.Items = r
return
}
func (s *GRPCProviderServer) RunAction(ctx context.Context, req *vagrant_provider.RunActionRequest) (resp *vagrant_provider.RunActionResponse, err error) {
resp = &vagrant_provider.RunActionResponse{}
func (s *GRPCProviderServer) RunAction(ctx context.Context, req *vagrant_proto.ExecuteAction) (resp *vagrant_proto.GenericResponse, err error) {
resp = &vagrant_proto.GenericResponse{}
var args, r interface{}
n := make(chan struct{}, 1)
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -282,13 +281,13 @@ func (s *GRPCProviderServer) RunAction(ctx context.Context, req *vagrant_provide
if err != nil {
return
}
resp.Data = string(result)
resp.Result = string(result)
return
}
func (s *GRPCProviderServer) Info(ctx context.Context, req *vagrant_common.NullRequest) (*vagrant_provider.InfoResponse, error) {
func (s *GRPCProviderServer) Info(ctx context.Context, req *vagrant_proto.Empty) (*vagrant_proto.PluginInfo, error) {
var r *vagrant.ProviderInfo
n := make(chan struct{}, 1)
n := make(chan struct{})
go func() {
r = s.Impl.Info()
n <- struct{}{}
@ -299,15 +298,15 @@ func (s *GRPCProviderServer) Info(ctx context.Context, req *vagrant_common.NullR
case <-n:
}
return &vagrant_provider.InfoResponse{
return &vagrant_proto.PluginInfo{
Description: r.Description,
Priority: r.Priority}, nil
}
func (s *GRPCProviderServer) IsInstalled(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_common.IsResponse, err error) {
resp = &vagrant_common.IsResponse{}
func (s *GRPCProviderServer) IsInstalled(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.Valid, err error) {
resp = &vagrant_proto.Valid{}
var r bool
n := make(chan struct{}, 1)
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -328,10 +327,10 @@ func (s *GRPCProviderServer) IsInstalled(ctx context.Context, req *vagrant_commo
return
}
func (s *GRPCProviderServer) IsUsable(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_common.IsResponse, err error) {
resp = &vagrant_common.IsResponse{}
func (s *GRPCProviderServer) IsUsable(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.Valid, err error) {
resp = &vagrant_proto.Valid{}
var r bool
n := make(chan struct{}, 1)
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -352,8 +351,8 @@ func (s *GRPCProviderServer) IsUsable(ctx context.Context, req *vagrant_common.E
return
}
func (s *GRPCProviderServer) SshInfo(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_provider.SshInfoResponse, err error) {
resp = &vagrant_provider.SshInfoResponse{}
func (s *GRPCProviderServer) SshInfo(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.MachineSshInfo, err error) {
resp = &vagrant_proto.MachineSshInfo{}
var r *vagrant.SshInfo
n := make(chan struct{}, 1)
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
@ -373,7 +372,7 @@ func (s *GRPCProviderServer) SshInfo(ctx context.Context, req *vagrant_common.Em
if err != nil {
return
}
resp = &vagrant_provider.SshInfoResponse{
resp = &vagrant_proto.MachineSshInfo{
Host: r.Host,
Port: r.Port,
Username: r.Username,
@ -381,10 +380,10 @@ func (s *GRPCProviderServer) SshInfo(ctx context.Context, req *vagrant_common.Em
return
}
func (s *GRPCProviderServer) State(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_provider.StateResponse, err error) {
resp = &vagrant_provider.StateResponse{}
func (s *GRPCProviderServer) State(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.MachineState, err error) {
resp = &vagrant_proto.MachineState{}
var r *vagrant.MachineState
n := make(chan struct{}, 1)
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -402,16 +401,15 @@ func (s *GRPCProviderServer) State(ctx context.Context, req *vagrant_common.Empt
if err != nil {
return
}
resp = &vagrant_provider.StateResponse{
resp = &vagrant_proto.MachineState{
Id: r.Id,
ShortDescription: r.ShortDesc,
LongDescription: r.LongDesc}
return
}
func (s *GRPCProviderServer) MachineIdChanged(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_common.EmptyResponse, err error) {
resp = &vagrant_common.EmptyResponse{}
n := make(chan struct{}, 1)
func (s *GRPCProviderServer) MachineIdChanged(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.Machine, err error) {
n := make(chan struct{})
m, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -424,9 +422,14 @@ func (s *GRPCProviderServer) MachineIdChanged(ctx context.Context, req *vagrant_
case <-ctx.Done():
case <-n:
}
mdata, err := vagrant.DumpMachine(m)
if err != nil {
return
}
resp = &vagrant_proto.Machine{Machine: mdata}
return
}
func (s *GRPCProviderServer) Name(ctx context.Context, req *vagrant_common.NullRequest) (*vagrant_common.NameResponse, error) {
return &vagrant_common.NameResponse{Name: s.Impl.Name()}, nil
func (s *GRPCProviderServer) Name(ctx context.Context, req *vagrant_proto.Empty) (*vagrant_proto.Identifier, error) {
return &vagrant_proto.Identifier{Name: s.Impl.Name()}, nil
}

View File

@ -8,8 +8,7 @@ import (
go_plugin "github.com/hashicorp/go-plugin"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_common"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto/vagrant_folder"
"github.com/hashicorp/vagrant/ext/go-plugin/vagrant/plugin/proto"
"github.com/LK4D4/joincontext"
)
@ -29,7 +28,7 @@ type GRPCSyncedFolderClient struct {
GRPCGuestCapabilitiesClient
GRPCHostCapabilitiesClient
GRPCIOClient
client vagrant_folder.SyncedFolderClient
client vagrant_proto.SyncedFolderClient
doneCtx context.Context
}
@ -43,7 +42,7 @@ func (c *GRPCSyncedFolderClient) Cleanup(ctx context.Context, m *vagrant.Machine
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
_, err = c.client.Cleanup(jctx, &vagrant_folder.CleanupRequest{
_, err = c.client.Cleanup(jctx, &vagrant_proto.SyncedFolders{
Machine: machine,
Options: string(opts)})
return handleGrpcError(err, c.doneCtx, ctx)
@ -63,7 +62,7 @@ func (c *GRPCSyncedFolderClient) Disable(ctx context.Context, m *vagrant.Machine
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
_, err = c.client.Disable(jctx, &vagrant_folder.Request{
_, err = c.client.Disable(jctx, &vagrant_proto.SyncedFolders{
Machine: machine,
Folders: string(folders),
Options: string(opts)})
@ -84,7 +83,7 @@ func (c *GRPCSyncedFolderClient) Enable(ctx context.Context, m *vagrant.Machine,
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
_, err = c.client.Enable(jctx, &vagrant_folder.Request{
_, err = c.client.Enable(jctx, &vagrant_proto.SyncedFolders{
Machine: machine,
Folders: string(folders),
Options: string(opts)})
@ -92,7 +91,7 @@ func (c *GRPCSyncedFolderClient) Enable(ctx context.Context, m *vagrant.Machine,
}
func (c *GRPCSyncedFolderClient) Info() *vagrant.SyncedFolderInfo {
resp, err := c.client.Info(context.Background(), &vagrant_common.NullRequest{})
resp, err := c.client.Info(context.Background(), &vagrant_proto.Empty{})
if err != nil {
return &vagrant.SyncedFolderInfo{}
}
@ -107,7 +106,7 @@ func (c *GRPCSyncedFolderClient) IsUsable(ctx context.Context, m *vagrant.Machin
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
resp, err := c.client.IsUsable(jctx, &vagrant_common.EmptyRequest{
resp, err := c.client.IsUsable(jctx, &vagrant_proto.Machine{
Machine: machine})
if err != nil {
return false, handleGrpcError(err, c.doneCtx, ctx)
@ -117,7 +116,7 @@ func (c *GRPCSyncedFolderClient) IsUsable(ctx context.Context, m *vagrant.Machin
}
func (c *GRPCSyncedFolderClient) Name() string {
resp, err := c.client.Name(context.Background(), &vagrant_common.NullRequest{})
resp, err := c.client.Name(context.Background(), &vagrant_proto.Empty{})
if err != nil {
return ""
}
@ -138,7 +137,7 @@ func (c *GRPCSyncedFolderClient) Prepare(ctx context.Context, m *vagrant.Machine
return
}
jctx, _ := joincontext.Join(ctx, c.doneCtx)
_, err = c.client.Prepare(jctx, &vagrant_folder.Request{
_, err = c.client.Prepare(jctx, &vagrant_proto.SyncedFolders{
Machine: machine,
Folders: string(folders),
Options: string(opts)})
@ -152,8 +151,8 @@ type GRPCSyncedFolderServer struct {
Impl SyncedFolder
}
func (s *GRPCSyncedFolderServer) Cleanup(ctx context.Context, req *vagrant_folder.CleanupRequest) (resp *vagrant_common.EmptyResponse, err error) {
resp = &vagrant_common.EmptyResponse{}
func (s *GRPCSyncedFolderServer) Cleanup(ctx context.Context, req *vagrant_proto.SyncedFolders) (resp *vagrant_proto.Empty, err error) {
resp = &vagrant_proto.Empty{}
machine, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -175,8 +174,8 @@ func (s *GRPCSyncedFolderServer) Cleanup(ctx context.Context, req *vagrant_folde
return
}
func (s *GRPCSyncedFolderServer) Disable(ctx context.Context, req *vagrant_folder.Request) (resp *vagrant_common.EmptyResponse, err error) {
resp = &vagrant_common.EmptyResponse{}
func (s *GRPCSyncedFolderServer) Disable(ctx context.Context, req *vagrant_proto.SyncedFolders) (resp *vagrant_proto.Empty, err error) {
resp = &vagrant_proto.Empty{}
machine, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -203,8 +202,8 @@ func (s *GRPCSyncedFolderServer) Disable(ctx context.Context, req *vagrant_folde
return
}
func (s *GRPCSyncedFolderServer) Enable(ctx context.Context, req *vagrant_folder.Request) (resp *vagrant_common.EmptyResponse, err error) {
resp = &vagrant_common.EmptyResponse{}
func (s *GRPCSyncedFolderServer) Enable(ctx context.Context, req *vagrant_proto.SyncedFolders) (resp *vagrant_proto.Empty, err error) {
resp = &vagrant_proto.Empty{}
machine, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -231,7 +230,7 @@ func (s *GRPCSyncedFolderServer) Enable(ctx context.Context, req *vagrant_folder
return
}
func (s *GRPCSyncedFolderServer) Info(ctx context.Context, req *vagrant_common.NullRequest) (*vagrant_folder.InfoResponse, error) {
func (s *GRPCSyncedFolderServer) Info(ctx context.Context, req *vagrant_proto.Empty) (*vagrant_proto.PluginInfo, error) {
n := make(chan struct{})
var r *vagrant.SyncedFolderInfo
go func() {
@ -243,13 +242,13 @@ func (s *GRPCSyncedFolderServer) Info(ctx context.Context, req *vagrant_common.N
return nil, nil
case <-n:
}
return &vagrant_folder.InfoResponse{
return &vagrant_proto.PluginInfo{
Description: r.Description,
Priority: r.Priority}, nil
}
func (s *GRPCSyncedFolderServer) IsUsable(ctx context.Context, req *vagrant_common.EmptyRequest) (resp *vagrant_common.IsResponse, err error) {
resp = &vagrant_common.IsResponse{}
func (s *GRPCSyncedFolderServer) IsUsable(ctx context.Context, req *vagrant_proto.Machine) (resp *vagrant_proto.Valid, err error) {
resp = &vagrant_proto.Valid{}
var r bool
machine, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
@ -272,12 +271,12 @@ func (s *GRPCSyncedFolderServer) IsUsable(ctx context.Context, req *vagrant_comm
return
}
func (s *GRPCSyncedFolderServer) Name(_ context.Context, req *vagrant_common.NullRequest) (*vagrant_common.NameResponse, error) {
return &vagrant_common.NameResponse{Name: s.Impl.Name()}, nil
func (s *GRPCSyncedFolderServer) Name(_ context.Context, req *vagrant_proto.Empty) (*vagrant_proto.Identifier, error) {
return &vagrant_proto.Identifier{Name: s.Impl.Name()}, nil
}
func (s *GRPCSyncedFolderServer) Prepare(ctx context.Context, req *vagrant_folder.Request) (resp *vagrant_common.EmptyResponse, err error) {
resp = &vagrant_common.EmptyResponse{}
func (s *GRPCSyncedFolderServer) Prepare(ctx context.Context, req *vagrant_proto.SyncedFolders) (resp *vagrant_proto.Empty, err error) {
resp = &vagrant_proto.Empty{}
machine, err := vagrant.LoadMachine(req.Machine, s.Impl)
if err != nil {
return
@ -306,7 +305,7 @@ func (s *GRPCSyncedFolderServer) Prepare(ctx context.Context, req *vagrant_folde
func (f *SyncedFolderPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Server) error {
f.Impl.Init()
vagrant_folder.RegisterSyncedFolderServer(s,
vagrant_proto.RegisterSyncedFolderServer(s,
&GRPCSyncedFolderServer{
Impl: f.Impl,
GRPCIOServer: GRPCIOServer{
@ -319,7 +318,7 @@ func (f *SyncedFolderPlugin) GRPCServer(broker *go_plugin.GRPCBroker, s *grpc.Se
}
func (f *SyncedFolderPlugin) GRPCClient(ctx context.Context, broker *go_plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) {
client := vagrant_folder.NewSyncedFolderClient(c)
client := vagrant_proto.NewSyncedFolderClient(c)
return &GRPCSyncedFolderClient{
GRPCIOClient: GRPCIOClient{
client: client,

View File

@ -27,7 +27,7 @@ func TestSyncedFolder_Cleanup(t *testing.T) {
err = impl.Cleanup(context.Background(), &vagrant.Machine{}, nil)
if err != nil {
t.Fatalf("bad resp: %s", err)
t.Fatalf("bad resp: %#v", err)
}
}