mock

package
v0.0.0-...-c0a7596 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientCmd

func NewClientCmd(ctx context.Context) *cobra.Command

NewCmd NewCmd

func NewServerCmd

func NewServerCmd(ctx context.Context) *cobra.Command

NewCmd NewCmd

Types

type ClientDemo

type ClientDemo struct {
}

func (*ClientDemo) Start

func (c *ClientDemo) Start(userID, protocol, addr string)

入口方法

type ClientHandler

type ClientHandler struct {
}

func (*ClientHandler) Disconnect

func (h *ClientHandler) Disconnect(id string) error

Disconnect default listener

func (*ClientHandler) Receive

func (h *ClientHandler) Receive(ag goim.Agent, payload []byte)

Receive default listener

type ServerDemo

type ServerDemo struct{}

func (*ServerDemo) Start

func (s *ServerDemo) Start(id, protocol, addr string)

type ServerHandler

type ServerHandler struct {
}

ServerHandler ServerHandler

func (*ServerHandler) Accept

func (h *ServerHandler) Accept(conn goim.Conn, timeout time.Duration) (string, goim.Metadata, error)

Accept this connection

func (*ServerHandler) Disconnect

func (h *ServerHandler) Disconnect(id string) error

Disconnect default listener

func (*ServerHandler) Receive

func (h *ServerHandler) Receive(ag goim.Agent, payload []byte)

Receive default listener

type StartOptions

type StartOptions struct {
	// contains filtered or unexported fields
}

StartOptions StartOptions

type TCPDialer

type TCPDialer struct {
	// contains filtered or unexported fields
}

func (*TCPDialer) DialAndHandshake

func (d *TCPDialer) DialAndHandshake(ctx goim.DialerContext) (net.Conn, error)

DialAndHandshake DialAndHandshake

type WebsocketDialer

type WebsocketDialer struct {
	// contains filtered or unexported fields
}

WebsocketDialer WebsocketDialer

func (*WebsocketDialer) DialAndHandshake

func (d *WebsocketDialer) DialAndHandshake(ctx goim.DialerContext) (net.Conn, error)

DialAndHandshake DialAndHandshake

Jump to

Keyboard shortcuts

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