mock

package
Version: v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetAddr

type NetAddr struct{}

NetAddr mock the net.Addr interface

func (NetAddr) Network

func (a NetAddr) Network() string

Network implements the net.Addr interface

func (NetAddr) String

func (a NetAddr) String() string

String implements the net.Addr interface

type NetworkEntity

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

NetworkEntity represents an network entity which can be used to construct the session object.

func NewNetworkEntity

func NewNetworkEntity() *NetworkEntity

NewNetworkEntity returns an mock network entity

func (*NetworkEntity) Close

func (n *NetworkEntity) Close() error

Close implements the session.NetworkEntity interface

func (*NetworkEntity) FindResponseByMID

func (n *NetworkEntity) FindResponseByMID(mid uint64) interface{}

FindResponseByMID returns the response respective the message id

func (*NetworkEntity) FindResponseByRoute

func (n *NetworkEntity) FindResponseByRoute(route string) interface{}

FindResponseByRoute returns the response respective the route

func (*NetworkEntity) LastMid

func (n *NetworkEntity) LastMid() uint64

LastMid implements the session.NetworkEntity interface

func (*NetworkEntity) LastResponse

func (n *NetworkEntity) LastResponse() interface{}

LastResponse returns the last respond message

func (*NetworkEntity) Push

func (n *NetworkEntity) Push(route string, v interface{}) error

Push implements the session.NetworkEntity interface

func (*NetworkEntity) RPC

func (n *NetworkEntity) RPC(route string, v interface{}) error

RPC implements the session.NetworkEntity interface

func (*NetworkEntity) RemoteAddr

func (n *NetworkEntity) RemoteAddr() net.Addr

RemoteAddr implements the session.NetworkEntity interface

func (*NetworkEntity) Response

func (n *NetworkEntity) Response(v interface{}) error

Response implements the session.NetworkEntity interface

func (*NetworkEntity) ResponseMid

func (n *NetworkEntity) ResponseMid(mid uint64, v interface{}) error

ResponseMid implements the session.NetworkEntity interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL