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

direct

package
v1.3.104-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package direct pkg/dmsg/direct/client.go c1-net-dmsg

Package direct pkg/dmsg/direct/direct.go c1-net-dmsg

Package direct pkg/dmsg/direct/entries.go c1-net-dmsg

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllEntries

func GetAllEntries(pks cipher.PubKeys, servers []*disc.Entry) (entries []*disc.Entry)

GetAllEntries gives all the entries

func GetClientEntry

func GetClientEntry(pks cipher.PubKeys, servers []*disc.Entry) (clients []*disc.Entry)

GetClientEntry gives all client entries

func NewClient

func NewClient(entries []*disc.Entry, log *logging.Logger) disc.APIClient

NewClient constructs a new APIClient that communicates with discovery via http.

func StartDmsg

func StartDmsg(ctx context.Context, log *logging.Logger, pk cipher.PubKey, sk cipher.SecKey,
	dClient disc.APIClient, config *dmsg.Config) (dmsgDC *dmsg.Client, stop func(), err error)

StartDmsg starts dmsg directly without the discovery.

func StartDmsgWithSetup

func StartDmsgWithSetup(ctx context.Context, log *logging.Logger, pk cipher.PubKey, sk cipher.SecKey,
	dClient disc.APIClient, config *dmsg.Config, beforeServe func(*dmsg.Client) error) (dmsgDC *dmsg.Client, stop func(), err error)

StartDmsgWithSetup builds the dmsg client, runs beforeServe (if non-nil) to FINISH configuring it — installing the final discovery client and/or the HTTP-over-dmsg transport — and only THEN serves and waits for Ready.

Running setup BEFORE Serve is load-bearing, not cosmetic: the client's entry- update (registration) loop starts during Serve, so a discovery client or transport installed AFTER Serve misses the first registration tick and the client can sit unregistered for minutes / forever. This is the shared register-before-serve invariant — the native visor wires dmsg exactly this way (pkg/visor/init_dmsg.go: NewClient(disc) → set transport → Serve), and the seeded/edge path (dmsgclient.StartDmsgSeeded) regressed precisely by violating it (serve-with-bare-client, upgrade-after) until #3277. Both now funnel through here so they cannot drift on it again.

Types

This section is empty.

Jump to

Keyboard shortcuts

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