Fix monitor

This commit is contained in:
世界 2023-08-07 19:54:17 +08:00
parent 59b86002c4
commit 0a68b9f1d8
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
9 changed files with 80 additions and 87 deletions

View file

@ -10,14 +10,14 @@ import (
var ErrNoRoute = E.New("no route to internet")
type (
NetworkUpdateCallback = func() error
DefaultInterfaceUpdateCallback = func(event int) error
NetworkUpdateCallback = func()
DefaultInterfaceUpdateCallback = func(event int)
)
const (
EventInterfaceUpdate = iota
EventAndroidVPNUpdate
EventNoRoute
EventInterfaceUpdate = 1
EventAndroidVPNUpdate = 2
EventNoRoute = 4
)
type NetworkUpdateMonitor interface {
@ -25,7 +25,6 @@ type NetworkUpdateMonitor interface {
Close() error
RegisterCallback(callback NetworkUpdateCallback) *list.Element[NetworkUpdateCallback]
UnregisterCallback(element *list.Element[NetworkUpdateCallback])
E.Handler
}
type DefaultInterfaceMonitor interface {