talk

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialers map[string]Dialer

Dialers is map of transport strings to Dialers and includes all builtin transports

Functions

This section is empty.

Types

type Dialer

type Dialer func(addr string) (*mux.Session, error)

A Dialer connects to address and establishes a mux.Session

type Peer

type Peer struct {
	*mux.Session
	*rpc.Client
	*rpc.RespondMux
	codec.Codec
}

Peer is a mux session, RPC client and responder, all in one.

func Dial

func Dial(transport, addr string, codec codec.Codec) (*Peer, error)

Dial connects to a remote address using a registered transport and returns a Peer. Available transports are "tcp", "unix", "ws", and "stdio". In the case of "stdio", the addr can be left an empty string.

func NewPeer

func NewPeer(session *mux.Session, codec codec.Codec) *Peer

NewPeer returns a Peer based on a session and codec.

func (*Peer) Close

func (p *Peer) Close() error

Close will close the underlying session.

func (*Peer) Respond

func (p *Peer) Respond()

Respond lets the Peer respond to incoming channels like a server, using any registered handlers.

Jump to

Keyboard shortcuts

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