mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-23 03:17:43 +00:00
ipn/localapi: plumb an event bus through the localapi.Handler (#16892)
Some of the operations of the local API need an event bus to correctly instantiate other components (notably including the portmapper). This commit adds that, and as the parameter list is starting to get a bit long and hard to read, I took the opportunity to move the arguments to a config type. Only a few call sites needed to be updated and this API is not intended for general use, so I did not bother to stage the change. Updates #15160 Updates #16842 Change-Id: I7b057d71161bd859f5acb96e2f878a34c85be0ef Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
@@ -209,11 +209,8 @@ func (m *pmpMapping) Release(ctx context.Context) {
|
||||
|
||||
// Config carries the settings for a [Client].
|
||||
type Config struct {
|
||||
// EventBus, if non-nil, is used for event publication and subscription by
|
||||
// portmapper clients created from this config.
|
||||
//
|
||||
// TODO(creachadair): As of 2025-03-19 this is optional, but is intended to
|
||||
// become required non-nil.
|
||||
// EventBus, which must be non-nil, is used for event publication and
|
||||
// subscription by portmapper clients created from this config.
|
||||
EventBus *eventbus.Bus
|
||||
|
||||
// Logf is called to generate text logs for the client. If nil, logger.Discard is used.
|
||||
|
Reference in New Issue
Block a user