drpold

package
v0.0.0-...-7169df1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint

	DoneChan chan bool
	// contains filtered or unexported fields
}

Client

func (*Client) Open

func (dc *Client) Open(wsTarget string, user string, pass string) error

Open - Establish session

type DRPCmd

type DRPCmd struct {
	DRPPacket
	Method *string      `json:"method"`
	Params DRPCmdParams `json:"params"`
	Token  *string      `json:"token"`
}

type DRPCmdParams

type DRPCmdParams map[string]interface{}

DRPCmdParams - DRP Cmd parameters

type DRPEndpointMethod

type DRPEndpointMethod func(DRPCmdParams, *websocket.Conn, *string) interface{}

DRPEndpointMethod - DRP Endpoint method

type DRPPacket

type DRPPacket struct {
	Type string `json:"type"`
}

type DRPPacketIn

type DRPPacketIn struct {
	Type    string       `json:"type"`
	Method  *string      `json:"method"`
	Params  DRPCmdParams `json:"params"`
	Token   *string      `json:"token"`
	Status  int          `json:"status"`
	Payload interface{}  `json:"payload"`
}

DRPPacketIn Message in; could be a Cmd or Reply

type DRPReply

type DRPReply struct {
	DRPPacket
	Token   *string     `json:"token"`
	Status  int         `json:"status"`
	Payload interface{} `json:"payload"`
}

type Endpoint

type Endpoint struct {
	EndpointCmds      map[string]DRPEndpointMethod
	ReplyHandlerQueue map[string](chan DRPPacketIn)
	TokenNum          int
	// contains filtered or unexported fields
}

Endpoint - DRP endpoint

func (*Endpoint) AddReplyHandler

func (e *Endpoint) AddReplyHandler() string

func (*Endpoint) CloseHandler

func (e *Endpoint) CloseHandler()

func (*Endpoint) DeleteReplyHandler

func (e *Endpoint) DeleteReplyHandler()

func (*Endpoint) ErrorHandler

func (e *Endpoint) ErrorHandler()

func (*Endpoint) GetCmds

func (e *Endpoint) GetCmds(DRPCmdParams, *websocket.Conn, *string) interface{}

func (*Endpoint) GetToken

func (e *Endpoint) GetToken() string

func (*Endpoint) Init

func (e *Endpoint) Init()

func (*Endpoint) OpenHandler

func (e *Endpoint) OpenHandler()

func (*Endpoint) ProcessCmd

func (e *Endpoint) ProcessCmd(wsConn *websocket.Conn, msgIn DRPPacketIn)

func (*Endpoint) ProcessReply

func (e *Endpoint) ProcessReply(msgIn DRPPacketIn)

func (*Endpoint) ReceiveMessage

func (e *Endpoint) ReceiveMessage(wsConn *websocket.Conn, msgIn DRPPacketIn)

func (*Endpoint) RegisterCmd

func (e *Endpoint) RegisterCmd(methodName string, method DRPEndpointMethod)

func (*Endpoint) SendCmd

func (e *Endpoint) SendCmd(methodName string, cmdParams DRPCmdParams) string

SendCmd

func (*Endpoint) SendCmdAwait

func (e *Endpoint) SendCmdAwait(cmdName string, cmdParams DRPCmdParams) DRPPacketIn

SendCmdAwait

func (*Endpoint) SendCmdSubscribe

func (e *Endpoint) SendCmdSubscribe(topicName string, scope string, returnChan chan DRPPacketIn)

SendCmdSubscribe

func (*Endpoint) SendReply

func (e *Endpoint) SendReply(wsConn *websocket.Conn, replyToken *string, returnStatus int, returnPayload interface{})

func (*Endpoint) SendStream

func (e *Endpoint) SendStream()

Jump to

Keyboard shortcuts

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