core

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChordApiClient

func NewChordApiClient(hostNode *chord.LocalNode, olPeer *overlay.OverlayPeer, proxyAddress *string, timeout time.Duration) chord.Transport

func NewDummyTCPListener added in v0.0.6

func NewDummyTCPListener(listenAddrStr string) net.Listener

Types

type ApiClient

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

func (*ApiClient) DeleteValueInnerRPC

func (c *ApiClient) DeleteValueInnerRPC(ctx context.Context, to *model.NodeRef, key *string) (bool, error)

func (*ApiClient) FindClosestPrecedingNodeRPC

func (c *ApiClient) FindClosestPrecedingNodeRPC(ctx context.Context, to *model.NodeRef, id model.HashID) (chord.RingNode, error)

func (*ApiClient) FindSuccessorByListRPC

func (c *ApiClient) FindSuccessorByListRPC(ctx context.Context, to *model.NodeRef, id model.HashID) (chord.RingNode, error)

func (*ApiClient) FindSuccessorByTableRPC

func (c *ApiClient) FindSuccessorByTableRPC(ctx context.Context, to *model.NodeRef, id model.HashID) (chord.RingNode, error)

func (*ApiClient) GetValueInnerRPC

func (c *ApiClient) GetValueInnerRPC(ctx context.Context, to *model.NodeRef, key *string) (*string, bool, error)

func (*ApiClient) NotifyRPC

func (c *ApiClient) NotifyRPC(ctx context.Context, to *model.NodeRef, node *model.NodeRef) error

func (*ApiClient) PingRPC

func (c *ApiClient) PingRPC(ctx context.Context, to *model.NodeRef) error

func (*ApiClient) PredecessorRPC

func (c *ApiClient) PredecessorRPC(ctx context.Context, to *model.NodeRef) (chord.RingNode, error)

func (*ApiClient) PutValueInnerRPC

func (c *ApiClient) PutValueInnerRPC(ctx context.Context, to *model.NodeRef, key *string, value *string) (bool, error)

func (*ApiClient) Shutdown

func (c *ApiClient) Shutdown()

func (*ApiClient) SuccessorsRPC

func (c *ApiClient) SuccessorsRPC(ctx context.Context, to *model.NodeRef) ([]chord.RingNode, error)

type DummyTCPConn added in v0.0.6

type DummyTCPConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewDummyTCPConn added in v0.0.6

func NewDummyTCPConn(orgTCPConn *net.Conn, dummyRemoteAddr net.Addr) *DummyTCPConn

func (*DummyTCPConn) RemoteAddr added in v0.0.6

func (dtc *DummyTCPConn) RemoteAddr() net.Addr

type DummyTCPListener added in v0.0.6

type DummyTCPListener struct {
	net.TCPListener
}

func (*DummyTCPListener) Accept added in v0.0.6

func (dtl *DummyTCPListener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener.

type ExternalServer

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

ExternalServer represents gRPC server to expose for gord users

func NewExternalServer

func NewExternalServer(process *chord.Process, port string) *ExternalServer

NewExternalServer creates an gRPC server to expose

func (*ExternalServer) FindHostForKey

FindHostForKey search for a given key's node. It is implemented for PublicService.

func (*ExternalServer) Run

func (g *ExternalServer) Run()

Run runs chord server.

func (*ExternalServer) Shutdown

func (g *ExternalServer) Shutdown()

Shutdown shutdowns gRPC server.

type InternalServer

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

InternalServer represents gRPC server to expose for internal chord processes

func NewChordServer

func NewChordServer(process *chord.Process, olPeer *overlay.OverlayPeer, port string, opts ...InternalServerOptionFunc) *InternalServer

NewChordServer creates a chord server

func (*InternalServer) FindClosestPrecedingNode

func (is *InternalServer) FindClosestPrecedingNode(ctx context.Context, req *connect.Request[server.FindRequest]) (*connect.Response[server.Node], error)

func (*InternalServer) FindSuccessorByList

func (is *InternalServer) FindSuccessorByList(ctx context.Context, req *connect.Request[server.FindRequest]) (*connect.Response[server.Node], error)

func (*InternalServer) FindSuccessorByTable

func (is *InternalServer) FindSuccessorByTable(ctx context.Context, req *connect.Request[server.FindRequest]) (*connect.Response[server.Node], error)

func (*InternalServer) Notify

func (*InternalServer) Ping

func (*InternalServer) Predecessor

func (*InternalServer) Run

func (is *InternalServer) Run(ctx context.Context)

Run runs chord server.

func (*InternalServer) Shutdown

func (is *InternalServer) Shutdown()

func (*InternalServer) Successors

type InternalServerOptionFunc

type InternalServerOptionFunc func(option *chordOption)

InternalServerOptionFunc represents server options for internal

func WithNodeOption

func WithNodeOption(host string) InternalServerOptionFunc

func WithProcessOptions

func WithProcessOptions(opts ...chord.ProcessOptionFunc) InternalServerOptionFunc

func WithTimeoutConnNode

func WithTimeoutConnNode(duration time.Duration) InternalServerOptionFunc

Jump to

Keyboard shortcuts

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