rclone/vendor/storj.io/drpc/drpcmux
2020-05-12 15:56:50 +00:00
..
doc.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
mux.go Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00
README.md Tardigrade Backend: Dependencies 2020-05-12 15:56:50 +00:00

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.