driver

package
v1.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultSocketPath = "/tmp/pilot.sock"

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn implements net.Conn over a Pilot Protocol stream.

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

type Datagram

type Datagram struct {
	SrcAddr protocol.Addr
	SrcPort uint16
	DstPort uint16
	Data    []byte
}

Datagram represents a received unreliable datagram.

type Driver

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

Driver is the main entry point for the Pilot Protocol SDK.

func Connect

func Connect(socketPath string) (*Driver, error)

Connect creates a new driver connected to the local daemon.

func (*Driver) ApproveHandshake

func (d *Driver) ApproveHandshake(nodeID uint32) (map[string]interface{}, error)

ApproveHandshake approves a pending trust handshake request.

func (*Driver) Close

func (d *Driver) Close() error

Close disconnects from the daemon.

func (*Driver) Deregister

func (d *Driver) Deregister() (map[string]interface{}, error)

Deregister removes the daemon from the registry.

func (*Driver) Dial

func (d *Driver) Dial(addr string) (*Conn, error)

Dial opens a stream connection to a remote address:port. addr format: "N:XXXX.YYYY.YYYY:PORT"

func (*Driver) DialAddr

func (d *Driver) DialAddr(dst protocol.Addr, port uint16) (*Conn, error)

DialAddr opens a stream connection to a remote Addr + port.

func (*Driver) Disconnect

func (d *Driver) Disconnect(connID uint32) error

Disconnect closes a connection by ID. Used by administrative tools.

func (*Driver) Handshake

func (d *Driver) Handshake(nodeID uint32, justification string) (map[string]interface{}, error)

Handshake sends a trust handshake request to a remote node.

func (*Driver) Health added in v1.5.1

func (d *Driver) Health() (map[string]interface{}, error)

Health returns a lightweight health check from the daemon.

func (*Driver) Info

func (d *Driver) Info() (map[string]interface{}, error)

Info returns the daemon's status information.

func (*Driver) Listen

func (d *Driver) Listen(port uint16) (*Listener, error)

Listen binds a port and returns a Listener that accepts connections.

func (*Driver) NetworkInvite added in v1.5.1

func (d *Driver) NetworkInvite(networkID uint16, targetNodeID uint32) (map[string]interface{}, error)

NetworkInvite invites a target node to a network (requires admin token on daemon).

func (*Driver) NetworkJoin added in v1.5.1

func (d *Driver) NetworkJoin(networkID uint16, token string) (map[string]interface{}, error)

NetworkJoin joins a network by ID, optionally using a token for token-gated networks.

func (*Driver) NetworkLeave added in v1.5.1

func (d *Driver) NetworkLeave(networkID uint16) (map[string]interface{}, error)

NetworkLeave leaves a network by ID.

func (*Driver) NetworkList added in v1.5.1

func (d *Driver) NetworkList() (map[string]interface{}, error)

NetworkList returns all networks known to the registry.

func (*Driver) NetworkMembers added in v1.5.1

func (d *Driver) NetworkMembers(networkID uint16) (map[string]interface{}, error)

NetworkMembers lists all members of a network.

func (*Driver) NetworkPollInvites added in v1.5.1

func (d *Driver) NetworkPollInvites() (map[string]interface{}, error)

NetworkPollInvites returns pending network invites for this node.

func (*Driver) NetworkRespondInvite added in v1.5.1

func (d *Driver) NetworkRespondInvite(networkID uint16, accept bool) (map[string]interface{}, error)

NetworkRespondInvite accepts or rejects a pending network invite.

func (*Driver) PendingHandshakes

func (d *Driver) PendingHandshakes() (map[string]interface{}, error)

PendingHandshakes returns pending trust handshake requests.

func (*Driver) RecvFrom

func (d *Driver) RecvFrom() (*Datagram, error)

RecvFrom receives the next incoming datagram.

func (*Driver) RejectHandshake

func (d *Driver) RejectHandshake(nodeID uint32, reason string) (map[string]interface{}, error)

RejectHandshake rejects a pending trust handshake request.

func (*Driver) ResolveHostname

func (d *Driver) ResolveHostname(hostname string) (map[string]interface{}, error)

ResolveHostname resolves a hostname to node info via the daemon.

func (*Driver) RevokeTrust

func (d *Driver) RevokeTrust(nodeID uint32) (map[string]interface{}, error)

RevokeTrust removes a peer from the trusted set and notifies the registry.

func (*Driver) SendTo

func (d *Driver) SendTo(dst protocol.Addr, port uint16, data []byte) error

SendTo sends an unreliable datagram to the given address:port. Use with broadcast addresses (Node=0xFFFFFFFF) to send to all network members.

func (*Driver) SetHostname

func (d *Driver) SetHostname(hostname string) (map[string]interface{}, error)

SetHostname sets or clears the daemon's hostname via the registry.

func (*Driver) SetTags

func (d *Driver) SetTags(tags []string) (map[string]interface{}, error)

SetTags sets the capability tags for this daemon's node.

func (*Driver) SetTaskExec

func (d *Driver) SetTaskExec(enabled bool) (map[string]interface{}, error)

SetTaskExec enables or disables task execution capability on the registry.

func (*Driver) SetVisibility

func (d *Driver) SetVisibility(public bool) (map[string]interface{}, error)

SetVisibility sets the daemon's visibility on the registry.

func (*Driver) SetWebhook

func (d *Driver) SetWebhook(url string) (map[string]interface{}, error)

SetWebhook sets or clears the daemon's webhook URL at runtime. An empty URL disables the webhook.

func (*Driver) TrustedPeers

func (d *Driver) TrustedPeers() (map[string]interface{}, error)

TrustedPeers returns all trusted peers from the handshake protocol.

type Listener

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

Listener implements net.Listener over a Pilot Protocol port.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

func (*Listener) Addr

func (l *Listener) Addr() net.Addr

func (*Listener) Close

func (l *Listener) Close() error

Jump to

Keyboard shortcuts

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