Fix monitor
This commit is contained in:
parent
59b86002c4
commit
0a68b9f1d8
9 changed files with 80 additions and 87 deletions
11
monitor.go
11
monitor.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue