rcode

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2020 License: MIT Imports: 17 Imported by: 0

README

rcode

Calling client VS Code from remote host.

If you use remote development using ssh, you can use code command on integrated terminal. But other terminals connecting to the remote host (such as iTerm2) can not use code command rcode enables to call VS Code from remote host.

Restriction

This needs to be able to connect client host machine from remote host.

how to use

MacOS client and Linux remote server on Virtual Machine on mac

MacOS

Install rcode.

go get github.com/74th/remote-vscode-cmd/cmd/rcode

Create rcode.command file to launch rcode. 10.37.129.2 is MacOS IP on Host Only Network.

/Users/nnyn/go/bin/rcode -server -addr 10.37.129.2:5450 -command code
chmod 755 rcode.command

Setting to launch rcode.command. "System Preferences..." -> "Users & Groups" -> select user -> "Login Items" -> Add -> select rcode.command

Virtual Machine

Install rcode.

go get github.com/74th/remote-vscode-cmd/cmd/rcode

Create /$HOME/.rcode.yaml .

  • client: MacOS IP on Host Only Network
  • remote_hostname: host name used by Remote Development SSH
client: 10.37.129.2:5450
remote_hostname: linux
using on Virtual Machine
rcode /some/dir

It will open /some/dir on VS Code on MacOS.

how it works

code has an argument --remote, it launches VS Code with Remote Development.

code --remote ssh-remote+hostname /some/dir

rcode /some/dir on the remote host connects rcode server on the client, and rcode on the client calls code --remote ssh-remote+hostname /some/dir.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_rcode_proto protoreflect.FileDescriptor

Functions

func CallServer

func CallServer(args []string)

func NewServer

func NewServer(host string, command string)

NewServer starts rcode server

func RegisterRcodeServer

func RegisterRcodeServer(s *grpc.Server, srv RcodeServer)

Types

type LaunchRequest

type LaunchRequest struct {
	RemoteHostname string   `protobuf:"bytes,1,opt,name=remote_hostname,json=remoteHostname,proto3" json:"remote_hostname,omitempty"`
	Args           []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*LaunchRequest) Descriptor deprecated

func (*LaunchRequest) Descriptor() ([]byte, []int)

Deprecated: Use LaunchRequest.ProtoReflect.Descriptor instead.

func (*LaunchRequest) GetArgs

func (x *LaunchRequest) GetArgs() []string

func (*LaunchRequest) GetRemoteHostname

func (x *LaunchRequest) GetRemoteHostname() string

func (*LaunchRequest) ProtoMessage

func (*LaunchRequest) ProtoMessage()

func (*LaunchRequest) ProtoReflect

func (x *LaunchRequest) ProtoReflect() protoreflect.Message

func (*LaunchRequest) Reset

func (x *LaunchRequest) Reset()

func (*LaunchRequest) String

func (x *LaunchRequest) String() string

type LaunchResponse

type LaunchResponse struct {
	ReturnCode int32  `protobuf:"varint,3,opt,name=return_code,json=returnCode,proto3" json:"return_code,omitempty"`
	Message    string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*LaunchResponse) Descriptor deprecated

func (*LaunchResponse) Descriptor() ([]byte, []int)

Deprecated: Use LaunchResponse.ProtoReflect.Descriptor instead.

func (*LaunchResponse) GetMessage

func (x *LaunchResponse) GetMessage() string

func (*LaunchResponse) GetReturnCode

func (x *LaunchResponse) GetReturnCode() int32

func (*LaunchResponse) ProtoMessage

func (*LaunchResponse) ProtoMessage()

func (*LaunchResponse) ProtoReflect

func (x *LaunchResponse) ProtoReflect() protoreflect.Message

func (*LaunchResponse) Reset

func (x *LaunchResponse) Reset()

func (*LaunchResponse) String

func (x *LaunchResponse) String() string

type RcodeClient

type RcodeClient interface {
	LaunchCode(ctx context.Context, in *LaunchRequest, opts ...grpc.CallOption) (*LaunchResponse, error)
}

RcodeClient is the client API for Rcode service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRcodeClient

func NewRcodeClient(cc grpc.ClientConnInterface) RcodeClient

type RcodeConf

type RcodeConf struct {
	Client         string `yaml:"client"`
	RemoteHostname string `yaml:"remote_hostname"`
}

type RcodeServer

type RcodeServer interface {
	LaunchCode(context.Context, *LaunchRequest) (*LaunchResponse, error)
}

RcodeServer is the server API for Rcode service.

type UnimplementedRcodeServer

type UnimplementedRcodeServer struct {
}

UnimplementedRcodeServer can be embedded to have forward compatible implementations.

func (*UnimplementedRcodeServer) LaunchCode

Directories

Path Synopsis
cmd
rcode command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL