Help us shape the future of Go! Take the 2026 Go Developer Survey

daemon

package
v0.19.12 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package daemon is the native Bridge service: the process `orb bridge run` serves, reached over private IPC sockets in the profile directory, its peers over Tailcat and WebSocket, the machine-level calls it answers peers (host.*), and its installation as a systemd user service or on a server over SSH. Its documents live in the native database when there is one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Admin

func Admin(ctx context.Context, state *native.State, profile string) (*protocol.Conn, error)

func Cache

func Cache(ctx context.Context, state *native.State, profile string) (_ *sqlite.Foreign, done func(), _ error)

Cache is the profile's previews of peers' conversations: in the native database, or in file mode in one beside the Bridge home, which done closes.

func EnsureSSH

func EnsureSSH(ctx context.Context, target, remoteOrb string, updater selfupdate.Updater) (string, error)

func Install

func Install(ctx context.Context, state *native.State, profile string) (string, error)

Install writes and starts the unit. The returned note says what is left for the owner, if anything (lingering, which may need sudo).

func Installed

func Installed(profile string) bool

Installed reports whether this profile's Bridge already runs as a user service.

func Ready

func Ready(ctx context.Context, client *protocol.Conn) (bool, error)

func Remove

func Remove(ctx context.Context, profile string) error

func Run

func Run(ctx context.Context, state *native.State, profile, version string, web Web) error

func RunSSH

func RunSSH(ctx context.Context, target, remoteOrb, profile string, args ...string) ([]byte, error)

func SSHCommand

func SSHCommand(target, remoteOrb, profile string, args ...string) ([]string, error)

func Start

func Start(ctx context.Context, state *native.State, profile string, explicit bool) error

func Systemctl

func Systemctl(ctx context.Context, args ...string) error

func UnitName

func UnitName(profile string) string

func WaitStopped

func WaitStopped(ctx context.Context, client *protocol.Conn) error

Types

type RestartInto

type RestartInto string

RestartInto asks the process that ran the service to become the binary at this path, once every listener and store is closed: an update keeps the process, so a supervisor keeps it too.

func (RestartInto) Error

func (r RestartInto) Error() string

type Service

type Service struct {
	*bridge.Peers
	// contains filtered or unexported fields
}

Service is a running Bridge on this machine: its peers, and the machine-level calls it serves them (host.*). Its state is the native database, or nil for files.

func New

func New(ctx context.Context, state *native.State, profile, version string, b *bridge.Bridge, node *transport.Node, webURL string) *Service

New serves b's peers over Tailcat (node) and, for ws:// and wss:// locators, WebSocket; webURL, when set, is the address invitations give.

type Web

type Web struct {
	Listen  string
	URL     string
	Origins []string
}

Jump to

Keyboard shortcuts

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