rpc

package
v0.0.0-...-c03468e Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an rpc client

func NewRpcClient

func NewRpcClient(addr string, logger log.Logger, ping func(client *rpc.Client) error) (*Client, error)

NewRpcClient create a new rpc client

func (*Client) Call

func (c *Client) Call(method string, args any, reply any) error

Call the remote method

type Server

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

func NewRpcServer

func NewRpcServer(logger log.Logger) (*Server, error)

NewRpcServer create a rpc server instance

func (*Server) Start

func (s *Server) Start(addr string, handler any) error

Start registers the handler and starts the server

Jump to

Keyboard shortcuts

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