router

package
v0.0.0-...-3b1ec4e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandldFunc

type HandldFunc = func(svr interface{}, ctx context.Context, req interface{}) (rsp interface{}, err error)

type HandleWrapper

type HandleWrapper func(ctx context.Context, req interface{}) (rsp interface{}, err error)

type MethodDesc

type MethodDesc struct {
	Name   string
	Method HandldFunc
}

method description

type Router

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

func NewRouter

func NewRouter() *Router

return a router

func (*Router) Forward

func (r *Router) Forward(rpcName string, handleFunc HandleWrapper)

func (*Router) RegisterService

func (r *Router) RegisterService(srvDesc *ServiceDesc, srvImpl interface{}) error

register service

func (*Router) Route

func (r *Router) Route(rpcName string) (HandleWrapper, error)

type ServiceDesc

type ServiceDesc struct {
	// like serviceName.serviceMethod
	Name   string
	Type   interface{}
	Method map[string]*MethodDesc
	Stream map[string]*StreamDesc
}

service description

type StreamDesc

type StreamDesc struct {
}

stream scription

Jump to

Keyboard shortcuts

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