import "github.com/lonnng/nano/mock"
type NetAddr struct{}
NetAddr mock the net.Addr interface
Network implements the net.Addr interface
String implements the net.Addr interface
type NetworkEntity struct {
// contains filtered or unexported fields
}
NetworkEntity represents an network entity which can be used to construct the session object.
func NewNetworkEntity() *NetworkEntity
NewNetworkEntity returns an mock network entity
func (n *NetworkEntity) Close() error
Close implements the session.NetworkEntity interface
func (n *NetworkEntity) FindResponseByMID(mid uint64) interface{}
FindResponseByMID returns the response respective the message id
func (n *NetworkEntity) FindResponseByRoute(route string) interface{}
FindResponseByRoute returns the response respective the route
func (n *NetworkEntity) LastMid() uint64
LastMid implements the session.NetworkEntity interface
func (n *NetworkEntity) LastResponse() interface{}
LastResponse returns the last respond message
func (n *NetworkEntity) Push(route string, v interface{}) error
Push implements the session.NetworkEntity interface
func (n *NetworkEntity) RPC(route string, v interface{}) error
RPC implements the session.NetworkEntity interface
func (n *NetworkEntity) RemoteAddr() net.Addr
RemoteAddr implements the session.NetworkEntity interface
func (n *NetworkEntity) Response(v interface{}) error
Response implements the session.NetworkEntity interface
func (n *NetworkEntity) ResponseMid(mid uint64, v interface{}) error
ResponseMid implements the session.NetworkEntity interface
Package mock imports 2 packages (graph). Updated 2019-07-05. Refresh now. Tools for package owners.