rpc

package
v0.0.0-...-b115306 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 9 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 {
	C *rpc.Client
	// contains filtered or unexported fields
}

Client is the client object used by Server to send requests to other Servers

func MakeClient

func MakeClient(endpoint string) *Client

func (*Client) Call

func (cli *Client) Call(meth string, args interface{}, response interface{}) bool

func (*Client) Connect

func (cli *Client) Connect() error

func (*Client) GetEndpoint

func (cli *Client) GetEndpoint() string

func (*Client) Status

func (cli *Client) Status() bool

type Server

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

Server is the rpc server that will be started in each Node of the cluster

func MakeServer

func MakeServer() *Server

MakeServer creates a Server object

func (*Server) AddService

func (rs *Server) AddService(svc *Service)

AddService to a Server

func (*Server) Start

func (rs *Server) Start(address string, rf interface{}, kv interface{}) error

Start

type Service

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

Service is an Object which has methods to be exposed through rpc, for example Raft and KVStore

func MakeService

func MakeService(rcvr interface{}) *Service

MakeService initializes a Service object

Jump to

Keyboard shortcuts

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