jsonrpc2net

package
v0.0.0-...-66cb45a Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 7 Imported by: 0

README

jsonrpc2 - net

just implemented the tcp yet.

check godoc for detail

Documentation

Overview

Package jsonrpc2net provides net(tcp, udp) implement of jsonrpc2(https://godoc.org/github.com/c0mm4nd/go-jsonrpc2), the fast jsonrpc 2.0 message encoding and decoding

Visit repo https://godoc.org/github.com/c0mm4nd/go-jsonrpc2 and get example

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonRpcHandler

type JsonRpcHandler interface {
	Handle(*jsonrpc2.JsonRpcMessage) *jsonrpc2.JsonRpcMessage
}

type Logger

type Logger interface {
	Debug(...interface{})
	Error(...interface{})
}

type Server

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

func NewServer

func NewServer(config ServerConfig) (*Server, error)

func (*Server) RegisterJsonRpcHandleFunc

func (s *Server) RegisterJsonRpcHandleFunc(method string, fn func(*jsonrpc2.JsonRpcMessage) *jsonrpc2.JsonRpcMessage)

func (*Server) RegisterJsonRpcHandler

func (s *Server) RegisterJsonRpcHandler(method string, handler JsonRpcHandler)

func (*Server) Serve

func (s *Server) Serve()

type ServerConfig

type ServerConfig struct {
	Network string
	Addr    string
	Logger  Logger
}

type SimpleLogger

type SimpleLogger struct{}

func (*SimpleLogger) Debug

func (logger *SimpleLogger) Debug(args ...interface{})

func (*SimpleLogger) Error

func (logger *SimpleLogger) Error(args ...interface{})

Jump to

Keyboard shortcuts

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