cluster

package
v0.0.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewCapability = vat.BasicCap{
		"view/packed",
		"view"}

	// ErrNotFound is returned when a lookup item was not found
	// in the routing table.
	ErrNotFound = errors.New("not found")
)
View Source
var HostCapability = vat.BasicCap{
	"host/packed",
	"host"}

Functions

This section is empty.

Types

type Dialer

type Dialer interface {
	Dial(context.Context, peer.AddrInfo) (*rpc.Conn, error)
}

----------------------------* | | | Client Implementations | | | *-----------------------------

type FutureRecord

type FutureRecord api.View_lookup_Results_Future

func (FutureRecord) Await

func (f FutureRecord) Await(ctx context.Context) (Record, error)

func (FutureRecord) Record

func (f FutureRecord) Record() (Record, error)

type FutureView

func (FutureView) Await

func (f FutureView) Await(ctx context.Context) (View, error)

func (FutureView) Err

func (f FutureView) Err() error

func (FutureView) View

func (f FutureView) View() View

type Host

type Host struct {
	Client *capnp.Client
	Info   peer.AddrInfo
	// contains filtered or unexported fields
}

func (*Host) Ls

func (h *Host) Ls(ctx context.Context, d Dialer) (*anchor.Iterator, capnp.ReleaseFunc)

func (*Host) View

func (h *Host) View(ctx context.Context, d Dialer) (FutureView, capnp.ReleaseFunc)

func (*Host) Walk

func (h *Host) Walk(ctx context.Context, d Dialer, path anchor.Path) (anchor.Anchor, capnp.ReleaseFunc)

Walk to the register located at path. Panics if len(path) == 0.

type HostServer

type HostServer struct {

	// The server policy for client instances created by Client().
	// If nil, reasonable defaults are used. Callers MUST set this
	// value before the first call to Client().
	*server.Policy

	// RoutingTable provides a global view of namespace peers.
	// Callers MUST set this value before the first call to Client()
	RoutingTable

	// The root anchor for the HostServer.  Users SHOULD NOT
	// set this field; it will be populated automatically on
	// the first call to Client().
	anchor.AnchorServer
	// contains filtered or unexported fields
}

HostServer represents a host instance on the network. It provides the Anchor and Joiner capabilities.

The zero-value HostServer is ready to use.

func (*HostServer) Client

func (h *HostServer) Client() *capnp.Client

func (*HostServer) View

func (h *HostServer) View(ctx context.Context, call cluster.Host_view) error

type Record

type Record api.View_Record

func (Record) Bind

func (r Record) Bind(rec routing.Record) error

func (Record) ID

func (r Record) ID() (peer.ID, error)

func (Record) Peer

func (r Record) Peer() peer.ID

func (Record) Seq

func (r Record) Seq() uint64

func (Record) TTL

func (r Record) TTL() time.Duration

func (Record) Validate

func (r Record) Validate() error

type RecordStream

type RecordStream struct {
	More bool
	Err  error
	// contains filtered or unexported fields
}

func (*RecordStream) Deadline

func (s *RecordStream) Deadline() (t time.Time)

func (*RecordStream) Finish

func (s *RecordStream) Finish()

func (*RecordStream) Next

func (s *RecordStream) Next()

func (*RecordStream) Record

func (s *RecordStream) Record() (r routing.Record)

func (*RecordStream) Send

func (s *RecordStream) Send(ctx context.Context, call chan_api.Sender_send) (err error)

func (*RecordStream) Shutdown

func (s *RecordStream) Shutdown()

type RoutingTable

type RoutingTable interface {
	Iter() routing.Iterator
	Lookup(peer.ID) (routing.Record, bool)
}

RoutingTable provides a global view of namespace peers.

type View

type View api.View

func (View) Iter

func (v View) Iter(ctx context.Context) *RecordStream

func (View) Lookup

func (v View) Lookup(ctx context.Context, id peer.ID) (FutureRecord, capnp.ReleaseFunc)

type ViewServer

type ViewServer struct {
	// RoutingTable provides a local cluster view for the host.
	RoutingTable
	*server.Policy
}

ViewServer provides query and iteration over a host's routing table.

func (ViewServer) Client

func (f ViewServer) Client() *capnp.Client

func (ViewServer) Iter

func (f ViewServer) Iter(ctx context.Context, call api.View_iter) error

func (ViewServer) Lookup

func (f ViewServer) Lookup(_ context.Context, call api.View_lookup) error

Jump to

Keyboard shortcuts

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