jrpc

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.4.0

type Option func(*jrpcOpt)

func WithCustomHeaders added in v0.4.0

func WithCustomHeaders(headersKey ...string) Option

WithCustomHeaders add custom headers to metadata.MD

func WithReadHeaderTimeout added in v0.4.0

func WithReadHeaderTimeout(timeout time.Duration) Option

WithReadHeaderTimeout set custom read header timeout

type Server

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

func NewServer

func NewServer(opts ...Option) *Server

NewServer create json rpc server

func (*Server) GracefulStop added in v0.2.0

func (s *Server) GracefulStop(ctx context.Context) error

GracefulStop stops the JRPC server gracefully. It stops the server from accepting new connections.

func (*Server) RegisterServices

func (s *Server) RegisterServices(svs ...Service)

RegisterServices register jgw servers to jrpc handler

func (*Server) Serve added in v0.2.0

func (s *Server) Serve(listener net.Listener) error

Serve accepts incoming connections on the listener lis.

type Service

type Service interface {
	Methods() map[string]method
}

Jump to

Keyboard shortcuts

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