ipn: move Options.Notify to its own method

We already had SetNotifyCallback elsewhere on controlclient, so use
that name.

Baby steps towards some CLI refactor work.

Updates tailscale/tailscale#1436
This commit is contained in:
Brad Fitzpatrick
2021-04-06 22:11:50 -07:00
parent d488678fdc
commit 799973a68d
8 changed files with 122 additions and 90 deletions

View File

@@ -90,13 +90,11 @@ func TestClientServer(t *testing.T) {
bc = NewBackendClient(clogf, clientToServer)
ch := make(chan Notify, 256)
h, err := NewHandle(bc, clogf, Options{
notify := func(n Notify) { ch <- n }
h, err := NewHandle(bc, clogf, notify, Options{
Prefs: &Prefs{
ControlURL: "http://example.com/fake",
},
Notify: func(n Notify) {
ch <- n
},
})
if err != nil {
t.Fatalf("NewHandle error: %v\n", err)