netrpc

package
v0.0.0-...-ab75566 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

netrpc package is a transporter client that uses golang's built-in net/rpc package for communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCoordinatorClient

func NewCoordinatorClient() transport.CoordinatorClient

func NewNodeClient

func NewNodeClient() transport.NodeClient

Types

type Client

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

func (*Client) Close

func (c *Client) Close() error

func (*Client) Connect

func (c *Client) Connect(addr string) error

type ClientWriteArgs

type ClientWriteArgs struct {
	Key   string
	Value []byte
}

---------------------------------------------------------------------------- net/rpc argument and reply structs

type CommitArgs

type CommitArgs struct {
	Key     string
	Version uint64
}

---------------------------------------------------------------------------- net/rpc argument and reply structs

type CoordinatorBinding

type CoordinatorBinding struct {
	Svc transport.CoordinatorService
}

CoordinatorBinding provides a layer of translation between the CoordinatorService which is transport agnostic and the net/rpc package. This allows using the net/rpc package to invoke CoordinatorService methods.

func (*CoordinatorBinding) AddNode

func (c *CoordinatorBinding) AddNode(addr *string, r *transport.NodeMeta) error

func (*CoordinatorBinding) RemoveNode

func (c *CoordinatorBinding) RemoveNode(addr *string, r *EmptyReply) error

func (*CoordinatorBinding) Write

func (c *CoordinatorBinding) Write(args *ClientWriteArgs, r *EmptyReply) error

type CoordinatorClient

type CoordinatorClient struct {
	*Client
}

CoordinatorClient is for invoking net/rpc methods on a Coordinator.

func (*CoordinatorClient) AddNode

func (cc *CoordinatorClient) AddNode(addr string) (*transport.NodeMeta, error)

func (*CoordinatorClient) RemoveNode

func (cc *CoordinatorClient) RemoveNode(addr string) error

func (*CoordinatorClient) Write

func (cc *CoordinatorClient) Write(k string, v []byte) error

type EmptyArgs

type EmptyArgs struct{}

---------------------------------------------------------------------------- net/rpc argument and reply structs

type EmptyReply

type EmptyReply struct{}

---------------------------------------------------------------------------- net/rpc argument and reply structs

type NodeBinding

type NodeBinding struct {
	Svc transport.NodeService
}

NodeBinding provides a layer of translation between the NodeService which is transport agnostic and the net/rpc package. This allows using the net/rpc package to invoke NodeService methods.

func (*NodeBinding) BackPropagate

func (n *NodeBinding) BackPropagate(
	args *transport.PropagateRequest,
	reply *transport.PropagateResponse,
) error

func (*NodeBinding) ClientWrite

func (n *NodeBinding) ClientWrite(args *ClientWriteArgs, _ *EmptyReply) error

func (*NodeBinding) Commit

func (n *NodeBinding) Commit(args *CommitArgs, _ *EmptyReply) error

func (*NodeBinding) FwdPropagate

func (n *NodeBinding) FwdPropagate(
	args *transport.PropagateRequest,
	reply *transport.PropagateResponse,
) error

func (*NodeBinding) LatestVersion

func (n *NodeBinding) LatestVersion(key string, reply *VersionResponse) error

func (*NodeBinding) Ping

func (n *NodeBinding) Ping(_ *EmptyArgs, _ *EmptyReply) error

func (*NodeBinding) Read

func (n *NodeBinding) Read(key string, reply *transport.Item) error

func (*NodeBinding) ReadAll

func (n *NodeBinding) ReadAll(_ *EmptyArgs, reply *[]transport.Item) error

func (*NodeBinding) Update

func (n *NodeBinding) Update(args *transport.NodeMeta, _ *EmptyReply) error

func (*NodeBinding) Write

func (n *NodeBinding) Write(args *WriteArgs, _ *EmptyReply) error

type NodeClient

type NodeClient struct {
	*Client
}

func (*NodeClient) BackPropagate

func (nc *NodeClient) BackPropagate(
	vByK *transport.PropagateRequest,
) (*transport.PropagateResponse, error)

func (*NodeClient) ClientWrite

func (nc *NodeClient) ClientWrite(key string, value []byte) error

func (*NodeClient) Commit

func (nc *NodeClient) Commit(key string, version uint64) error

func (*NodeClient) FwdPropagate

func (nc *NodeClient) FwdPropagate(
	vByK *transport.PropagateRequest,
) (*transport.PropagateResponse, error)

func (*NodeClient) LatestVersion

func (nc *NodeClient) LatestVersion(key string) (string, uint64, error)

func (*NodeClient) Ping

func (nc *NodeClient) Ping() error

func (*NodeClient) Read

func (nc *NodeClient) Read(key string) (string, []byte, error)

func (*NodeClient) ReadAll

func (nc *NodeClient) ReadAll() (*[]transport.Item, error)

func (*NodeClient) Update

func (nc *NodeClient) Update(meta *transport.NodeMeta) error

func (*NodeClient) Write

func (nc *NodeClient) Write(key string, value []byte, version uint64) error

type VersionResponse

type VersionResponse struct {
	Key     string
	Version uint64
}

---------------------------------------------------------------------------- net/rpc argument and reply structs

type WriteArgs

type WriteArgs struct {
	Key     string
	Value   []byte
	Version uint64
}

---------------------------------------------------------------------------- net/rpc argument and reply structs

Jump to

Keyboard shortcuts

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