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 ¶
- func GetAllEntries(pks cipher.PubKeys, servers []*disc.Entry) (entries []*disc.Entry)
- func GetClientEntry(pks cipher.PubKeys, servers []*disc.Entry) (clients []*disc.Entry)
- func NewClient(entries []*disc.Entry, log *logging.Logger) disc.APIClient
- func StartDmsg(ctx context.Context, log *logging.Logger, pk cipher.PubKey, sk cipher.SecKey, ...) (dmsgDC *dmsg.Client, stop func(), err error)
- func StartDmsgWithSetup(ctx context.Context, log *logging.Logger, pk cipher.PubKey, sk cipher.SecKey, ...) (dmsgDC *dmsg.Client, stop func(), err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllEntries ¶
GetAllEntries gives all the entries
func GetClientEntry ¶
GetClientEntry gives all client entries
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.