njrpc

package module
v0.0.0-...-90139a9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 13 Imported by: 0

README

nats-json-rpc

RPC based on NATs and JSON, implementation of net/rpc(Go language library)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShutdown = rpc.ErrShutdown
)

vars

Functions

This section is empty.

Types

type Client

type Client struct {
	Timeout int64
	// contains filtered or unexported fields
}

Client nat Client

func NewClientWithConn

func NewClientWithConn(conn *nats.Conn, url string, _logger *zap.Logger) *Client

NewClientWithConn NewClientWithConn

func (*Client) Call

func (client *Client) Call(subject, method string, args, receiver interface{}) error

Call Call

func (*Client) JSONCall

func (client *Client) JSONCall(queue, serviceMethod string, args *[]byte, reply *[]byte) error

JSONCall Call

type Server

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

func NewServer

func NewServer(_logger *zap.Logger) *Server

func (*Server) Register

func (server *Server) Register(rcvr interface{}) error

func (*Server) ServeConn

func (server *Server) ServeConn(ctx context.Context, natsConn *nats.Conn, queue string)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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