types/empty: add Message, stop using mysterious *struct{}

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-14 13:09:19 -08:00
committed by Brad Fitzpatrick
parent 4796f6fd67
commit 747c7d7ce2
5 changed files with 33 additions and 15 deletions
+10 -9
View File
@@ -9,6 +9,7 @@ import (
"tailscale.com/control/controlclient"
"tailscale.com/tailcfg"
"tailscale.com/types/empty"
"tailscale.com/wgengine"
)
@@ -39,15 +40,15 @@ type NetworkMap = controlclient.NetworkMap
// In any given notification, any or all of these may be nil, meaning
// that they have not changed.
type Notify struct {
Version string // version number of IPN backend
ErrMessage *string // critical error message, if any
LoginFinished *struct{} // event: login process succeeded
State *State // current IPN state has changed
Prefs *Prefs // preferences were changed
NetMap *NetworkMap // new netmap received
Engine *EngineStatus // wireguard engine stats
BrowseToURL *string // UI should open a browser right now
BackendLogID *string // public logtail id used by backend
Version string // version number of IPN backend
ErrMessage *string // critical error message, if any
LoginFinished *empty.Message // event: non-nil when login process succeeded
State *State // current IPN state has changed
Prefs *Prefs // preferences were changed
NetMap *NetworkMap // new netmap received
Engine *EngineStatus // wireguard engine stats
BrowseToURL *string // UI should open a browser right now
BackendLogID *string // public logtail id used by backend
}
// StateKey is an opaque identifier for a set of LocalBackend state
+2 -2
View File
@@ -17,6 +17,7 @@ import (
"tailscale.com/logger"
"tailscale.com/portlist"
"tailscale.com/tailcfg"
"tailscale.com/types/empty"
"tailscale.com/version"
"tailscale.com/wgengine"
"tailscale.com/wgengine/filter"
@@ -194,8 +195,7 @@ func (b *LocalBackend) Start(opts Options) error {
// Auth completed, unblock the engine
b.blockEngineUpdates(false)
b.authReconfig()
noargs := struct{}{}
b.send(Notify{LoginFinished: &noargs})
b.send(Notify{LoginFinished: &empty.Message{}})
}
if new.Persist != nil {
persist := *new.Persist // copy