rpctest

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiConnPair added in v0.2.0

func MultiConnPair(peerIdServ, peerIdClient string) (serv, client transport.MultiConn)

Types

type TestPool

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

func NewTestPool

func NewTestPool() *TestPool

func (*TestPool) AddPeer

func (t *TestPool) AddPeer(ctx context.Context, p peer.Peer) (err error)

func (*TestPool) Close

func (t *TestPool) Close(ctx context.Context) (err error)

func (*TestPool) Get

func (t *TestPool) Get(ctx context.Context, id string) (peer.Peer, error)

func (*TestPool) GetOneOf

func (t *TestPool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error)

func (*TestPool) Init

func (t *TestPool) Init(a *app.App) (err error)

func (*TestPool) Name

func (t *TestPool) Name() (name string)

func (*TestPool) Run

func (t *TestPool) Run(ctx context.Context) (err error)

func (*TestPool) WithServer

func (t *TestPool) WithServer(ts *TestServer) *TestPool

type TestServer added in v0.2.0

type TestServer struct {
	*drpcmux.Mux
	*drpcserver.Server
}

func NewTestServer

func NewTestServer() *TestServer

func (*TestServer) Close added in v0.2.0

func (s *TestServer) Close(ctx context.Context) (err error)

func (*TestServer) Dial added in v0.2.0

func (s *TestServer) Dial(peerId string) (clientPeer peer.Peer, err error)

func (*TestServer) DrpcConfig added in v0.2.0

func (s *TestServer) DrpcConfig() rpc.Config

func (*TestServer) Init added in v0.2.0

func (s *TestServer) Init(a *app.App) (err error)

func (*TestServer) Name added in v0.2.0

func (s *TestServer) Name() (name string)

func (*TestServer) Run added in v0.2.0

func (s *TestServer) Run(ctx context.Context) (err error)

func (*TestServer) ServeConn added in v0.2.0

func (s *TestServer) ServeConn(ctx context.Context, conn net.Conn) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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