rpc

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPCVERSION string = "1.3"
)

Variables

This section is empty.

Functions

func RpcCreateMessage

func RpcCreateMessage(msg interface{}) []byte

func RpcSendData

func RpcSendData(conn net.Conn, buf []byte) error

func RpcSendMessage

func RpcSendMessage(conn net.Conn, msg interface{}) error

Types

type RpcCommandResponse

type RpcCommandResponse struct {
	Version           string `json:"version"`
	Status            string `json:"status"`
	AccessId          int    `json:"accessid"`
	IsConnected       bool   `json:"isconnected"`
	IsRunning         bool   `json:"isrunning"`
	Uri               string `json:"uri"`
	RestrictedNetwork bool   `json:"restrictednetwork"`
	TunnelExists      bool   `json:"tunnelexists"`
}

type RpcCommandStart

type RpcCommandStart struct {
	Version           string `json:"version"`
	AccessId          int    `json:"accessid"`
	Uri               string `json:"uri"`
	Secret            string `json:"secret"`
	HeartbeatInterval int    `json:"heartbeatinterval"`
	RestrictedNetwork bool   `json:"restrictednetwork"`
	ClientID          string `json:"clientid"`
}

type RpcCommandStatus

type RpcCommandStatus struct {
	Version string `json:"version"`
}

type RpcCommandStop

type RpcCommandStop struct {
	Version string `json:"version"`
}

type RpcCommandType

type RpcCommandType uint16
const (
	RPCCOMMANDUNKNOWN  RpcCommandType = 0
	RPCCOMMANDSTART    RpcCommandType = 1
	RPCCOMMANDSTOP     RpcCommandType = 2
	RPCCOMMANDSTATUS   RpcCommandType = 3
	RPCCOMMANDRESPONSE RpcCommandType = 4
)

func RpcReadPacket

func RpcReadPacket(client net.Conn) (c RpcCommandType, ret []byte, err error)

Parse message header, get message type and content length

Jump to

Keyboard shortcuts

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