nano: github.com/lonnng/nano/mock Index | Files

package mock

import "github.com/lonnng/nano/mock"

Index

Package Files

network_entity.go

type NetAddr Uses

type NetAddr struct{}

NetAddr mock the net.Addr interface

func (NetAddr) Network Uses

func (a NetAddr) Network() string

Network implements the net.Addr interface

func (NetAddr) String Uses

func (a NetAddr) String() string

String implements the net.Addr interface

type NetworkEntity Uses

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

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

func NewNetworkEntity Uses

func NewNetworkEntity() *NetworkEntity

NewNetworkEntity returns an mock network entity

func (*NetworkEntity) Close Uses

func (n *NetworkEntity) Close() error

Close implements the session.NetworkEntity interface

func (*NetworkEntity) FindResponseByMID Uses

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

FindResponseByMID returns the response respective the message id

func (*NetworkEntity) FindResponseByRoute Uses

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

FindResponseByRoute returns the response respective the route

func (*NetworkEntity) LastMid Uses

func (n *NetworkEntity) LastMid() uint64

LastMid implements the session.NetworkEntity interface

func (*NetworkEntity) LastResponse Uses

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

LastResponse returns the last respond message

func (*NetworkEntity) Push Uses

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

Push implements the session.NetworkEntity interface

func (*NetworkEntity) RPC Uses

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

RPC implements the session.NetworkEntity interface

func (*NetworkEntity) RemoteAddr Uses

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

RemoteAddr implements the session.NetworkEntity interface

func (*NetworkEntity) Response Uses

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

Response implements the session.NetworkEntity interface

func (*NetworkEntity) ResponseMid Uses

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.