drpcmux

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 3 Imported by: 40

README

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.

Documentation

Overview

Package drpcmux is a handler to dispatch rpcs to implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

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

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.

Jump to

Keyboard shortcuts

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