message

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthRequestFlag   = "<A"
	AuthResponseFlag  = ">A"
	ProxyRequestFlag  = "<P"
	ProxyResponseFlag = ">P"
	PingFlag          = "<p"
	PongFlag          = ">q"
	CloseProxyFlag    = "<C"
	UDPMessageFlag    = "UM"
)

Variables

This section is empty.

Functions

func Send

func Send(any interface{}, writer io.Writer) error

Types

type AuthRequest

type AuthRequest struct {
	AuthToken string `json:"auth_token,omitempty"`
	HostName  string `json:"host_name,omitempty"`
	Os        string `json:"os,omitempty"`
}

type AuthResponse

type AuthResponse struct {
	ClientId string `json:"client_id,omitempty"`
	Result   string `json:"result,omitempty"`
}

type CloseProxy

type CloseProxy struct {
	ClientId  string `json:"client_id,omitempty"`
	ProxyName string `json:"name,omitempty"`
}

type Message

type Message interface{}

func Read

func Read(reader io.Reader) (Message, error)

type Ping

type Ping struct {
	ClientId  string `json:"client_id,omitempty"`
	Timestamp int64  `json:"timestamp,omitempty"`
}

type Pong

type Pong struct {
	Timestamp int64 `json:"timestamp,omitempty"`
}

type ProxyRequest

type ProxyRequest struct {
	ClientId   string `json:"client_id,omitempty"`
	ProxyName  string `json:"name,omitempty"`
	ProxyType  string `json:"type,omitempty"`
	ProxyIp    string `json:"ip,omitempty"`
	ProxyPort  string `json:"port,omitempty"`
	RemoteIp   string `json:"remote_ip,omitempty"`
	RemotePort string `json:"remote_port"`
}

type ProxyResponse

type ProxyResponse struct {
	ProxyName string `json:"name,omitempty"`
	Result    string `json:"result,omitempty"`
}

type UDPMessage

type UDPMessage struct {
	RemoteAddr *net.UDPAddr `json:"r,omitempty"`
	Content    []byte       `json:"c,omitempty"`
}

Jump to

Keyboard shortcuts

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