node

package
v0.0.0-...-ee3d063 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAction = errors.New("invalid action")
View Source
var ErrInvalidMetadata = errors.New("invalid metadata")
View Source
var ErrInvalidTarget = errors.New("invalid target")

Functions

This section is empty.

Types

type Connection

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

func (*Connection) Close

func (conn *Connection) Close()

type Entry

type Entry struct {
	Index  int      `msgpack:"index"`
	Route  []HostID `msgpack:"route"`
	Action string   `msgpack:"action"`
}

type HostID

type HostID = uuid.UUID

type Manager

type Manager struct {
	HostId HostID

	Connections map[HostID]*Connection
	Nodes       map[HostID]*nodeImpl
	Callback    map[string]func([]byte, HostID) ([]byte, error)
	// contains filtered or unexported fields
}

func NewManager

func NewManager() (*Manager, error)

func (*Manager) Close

func (man *Manager) Close()

func (*Manager) StartClient

func (man *Manager) StartClient(transport transport.ClientTransporter) error

func (*Manager) StartServe

func (man *Manager) StartServe(transporter transport.ServerTransporter) error

type Node

type Node interface {
	Host() HostID
	WaitClose(ctx context.Context)
	Call(action string, arg []byte) ([]byte, error)
}

type RouteInfo

type RouteInfo struct {
	Host        HostID   `msgpack:"host"`
	Connections []HostID `msgpack:"connections"`
}

Jump to

Keyboard shortcuts

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