peering

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 13 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 is an peering client to communicate with peers.

func NewClient

func NewClient(certFile string, keyFile string, caFile string, skipVerify bool) *Client

NewClient creates a new empty client to communicate with peers.

func (*Client) Destroy

func (c *Client) Destroy()

Destroy currently does nothing, but might delete open connections if they are implemented

func (*Client) SendAppend

func (c *Client) SendAppend(host string, kgname fred.KeygroupName, id string, value string) error

SendAppend sends this command to the server at this address

func (*Client) SendCreateKeygroup

func (c *Client) SendCreateKeygroup(host string, kgname fred.KeygroupName, expiry int) error

SendCreateKeygroup sends this command to the server at this address

func (*Client) SendDeleteKeygroup

func (c *Client) SendDeleteKeygroup(host string, kgname fred.KeygroupName) error

SendDeleteKeygroup sends this command to the server at this address

func (*Client) SendGetAllItems

func (c *Client) SendGetAllItems(host string, kgname fred.KeygroupName) ([]fred.Item, error)

SendGetAllItems sends this command to the server at this address

func (*Client) SendGetItem

func (c *Client) SendGetItem(host string, kgname fred.KeygroupName, id string) ([]fred.Item, error)

SendGetItem sends this command to the server at this address

func (*Client) SendUpdate

func (c *Client) SendUpdate(host string, kgname fred.KeygroupName, id string, value string, tombstoned bool, vvector vclock.VClock) error

SendUpdate sends this command to the server at this address

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

Server is a grpc server that lets peers access the internal handler.

func NewServer

func NewServer(host string, handler *fred.IntHandler, certFile string, keyFile string, caFile string, skipVerify bool) *Server

NewServer creates a new Server for communication to the inthandler from other nodes

func (*Server) AppendItem

func (s *Server) AppendItem(_ context.Context, request *peering.AppendItemRequest) (*peering.Empty, error)

AppendItem calls HandleAppend on the Inthandler

func (*Server) Close

func (s *Server) Close() error

Close closes the grpc server for internal communication.

func (*Server) CreateKeygroup

func (s *Server) CreateKeygroup(_ context.Context, request *peering.CreateKeygroupRequest) (*peering.Empty, error)

CreateKeygroup calls this Method on the Inthandler

func (*Server) DeleteKeygroup

func (s *Server) DeleteKeygroup(_ context.Context, request *peering.DeleteKeygroupRequest) (*peering.Empty, error)

DeleteKeygroup calls this Method on the Inthandler

func (*Server) GetAllItems

GetAllItems has no implementation

func (*Server) GetItem

GetItem has no implementation

func (*Server) PutItem

func (s *Server) PutItem(ctx context.Context, request *peering.PutItemRequest) (*peering.Empty, error)

PutItem calls HandleUpdate on the Inthandler

Jump to

Keyboard shortcuts

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