Documentation ¶
Index ¶
Constants ¶
View Source
const ( CmdPort = 65501 EvtPort = 65502 )
Channel ports
Variables ¶
View Source
var ( ErrNoData = errors.New("no data") ErrFrameTIDMismatch = errors.New("frame TID mismatch") ErrFrameUnexpected = errors.New("unexpected frame type") ErrRemoteError = errors.New("remote error") ErrWaitTimeout = errors.New("wait timeout") ErrFrameMalformed = errors.New("malformed frame") )
Functions ¶
func GenerateTID ¶
func GenerateTID() string
Types ¶
type CommandClient ¶
type CommandClient struct {
*Client
}
func NewCommandClient ¶
func NewCommandClient(addr string, connectWait, connectTimeout, readTimeout, writeTimeout int) (*CommandClient, error)
type CommandServer ¶
type CommandServer struct { *Server // contains filtered or unexported fields }
func NewCommandServer ¶
func NewCommandServer(addr string, handler RequestHandler) *CommandServer
func (*CommandServer) OnConnection ¶
func (s *CommandServer) OnConnection(conn net.Conn)
func (*CommandServer) SetReqHandler ¶
func (s *CommandServer) SetReqHandler(handler RequestHandler)
func (*CommandServer) WaitForConnection ¶
func (s *CommandServer) WaitForConnection()
type ConnectionHandler ¶
type EventClient ¶
type EventClient struct {
*Client
}
func NewEventClient ¶
func NewEventClient(addr string, connectWait, connectTimeout, readTimeout int) (*EventClient, error)
type EventServer ¶
type EventServer struct { *Server // contains filtered or unexported fields }
func NewEventServer ¶
func NewEventServer(addr string) *EventServer
func (*EventServer) OnConnection ¶
func (s *EventServer) OnConnection(conn net.Conn)
func (*EventServer) WaitForConnection ¶
func (s *EventServer) WaitForConnection()
type Frame ¶
type Frame struct { TID string `json:"tid"` Type FrameType `json:"type"` Body json.RawMessage `json:"body,omitempty"` }
type RequestHandler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) SetConnHandler ¶
func (s *Server) SetConnHandler(handler ConnectionHandler)
Click to show internal directories.
Click to hide internal directories.