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

linkreg

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package linkreg is the process's open runtime links as an embedded Studio sees them (U20.2, UX-D-01): weft/runtime adds a link when Install opens it and removes it when the link stops, and weft/studio reads the list for /api/meta's runtime_link — whether this process's link talks to this very server in-process, or which Studio it dialled instead. An app that embeds Studio (setup A) and whose link dialled another Studio (weft dev's) can then say where its runtime went, instead of reading as an app whose link is closed.

It exists because weft/runtime imports weft/studio (runtime.Local takes a *studio.Server), so studio cannot ask runtime directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(l *Link) (remove func())

Add records l as open; the returned function removes it (idempotent).

Types

type Link struct {
	// Local is the *studio.Server an in-process link talks to
	// (runtime.Local); nil for a link that dials over HTTP.
	Local any
	// StudioURL is the Studio an HTTP link dialled, without userinfo,
	// query or fragment (the registration's studio_url); "" in-process.
	StudioURL string
	// Instance is the link's random tag on every registration
	// (Registration.Instance): a Studio that holds a registration with
	// it is the Studio this HTTP link dialled — the same server, over a
	// socket — and not another one.
	Instance string
}

Link is one open runtime link.

func All

func All() []Link

All lists the open links, HTTP links ordered by their Studio URL.

Jump to

Keyboard shortcuts

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