rpc

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HandlerName = "Handler.Execute"

HandlerName provides the name of the method the RPC client should call via the RPC interface.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Port uint
	// contains filtered or unexported fields
}

Client contains the configuration for RPC client

func (*Client) Close

func (c *Client) Close() (err error)

Close gracefully terminates the underlying RPC client

func (*Client) Execute

func (c *Client) Execute(req Request) (ok bool, msg string, err error)

Execute an RPC request

func (*Client) InitRPC added in v0.2.0

func (c *Client) InitRPC() (close func() error, err error)

InitRPC initializes the underlying RPC client A close callback is returned that can be deferred if InitRPC succeeds.

type Request

type Request struct {
	Name               RequestType
	StartVNCServerArgs StartVNCServerRequestArgs
	StopVNCServerArgs  StopVNCServerRequestArgs
}

Request identifies what method to call and arguments to pass.

type RequestType

type RequestType string

RequestType indicates the type of request

const (
	// StartVNCServer request
	StartVNCServer RequestType = "Start"
	// StopVNCServer request
	StopVNCServer RequestType = "Stop"
	// IsVNCServerActive request
	IsVNCServerActive RequestType = "IsActive"
)

type Response

type Response struct {
	Ok      bool
	Message string
}

Response informs client about success of request.

type StartVNCServerRequestArgs added in v0.2.0

type StartVNCServerRequestArgs struct {
	Port   int
	Passwd string
	Shared bool
}

StartVNCServerRequestArgs holds arguments for a StartVNCServer Request. Port is the VNC Server Port Passwd is the VNC Server Password Shared indicates whether the VNC Server allows multiple connections

type StopVNCServerRequestArgs added in v0.2.0

type StopVNCServerRequestArgs struct {
	DisconnectClients bool
}

StopVNCServerRequestArgs holds arguments for a StopVNCServer Request. DisconnectClients indicates whether the VNC Server should close all client connections when shutting down.

Jump to

Keyboard shortcuts

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