.. | ||
doc.go | ||
mux.go | ||
README.md |
package drpcmux
import "storj.io/drpc/drpcmux"
Package drpcmux is a handler to dispatch rpcs to implementations.
Usage
type Mux
type Mux struct {
}
Mux is an implementation of Handler to serve drpc connections to the appropriate Receivers registered by Descriptions.
func New
func New() *Mux
New constructs a new Mux.
func (*Mux) HandleRPC
func (m *Mux) HandleRPC(stream drpc.Stream, rpc string) (err error)
HandleRPC handles the rpc that has been requested by the stream.
func (*Mux) Register
func (m *Mux) Register(srv interface{}, desc drpc.Description) error
Register associates the rpcs described by the description in the server. It returns an error if there was a problem registering it.