aboutsummaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 01:59:14 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-03 02:07:53 +0100
commit79eb071e6a661b9b3df14df9791558eb03c4c8b9 (patch)
tree32d37253d5248de6bbc42241bbeaefd205c5d7ee /conf
parentipc: work out service state transitions (diff)
downloadwireguard-windows-79eb071e6a661b9b3df14df9791558eb03c4c8b9.tar.xz
wireguard-windows-79eb071e6a661b9b3df14df9791558eb03c4c8b9.zip
callbacks: use cb as receiver for unregister
Diffstat (limited to 'conf')
-rw-r--r--conf/storewatcher.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/conf/storewatcher.go b/conf/storewatcher.go
index 7a5ab387..ffd20ee0 100644
--- a/conf/storewatcher.go
+++ b/conf/storewatcher.go
@@ -5,20 +5,20 @@
package conf
-type storeCallback struct {
+type StoreCallback struct {
cb func()
}
-var storeCallbacks = make(map[*storeCallback]bool)
+var storeCallbacks = make(map[*StoreCallback]bool)
-func RegisterStoreChangeCallback(cb func()) *storeCallback {
+func RegisterStoreChangeCallback(cb func()) *StoreCallback {
startWatchingConfigDir()
cb()
- s := &storeCallback{cb}
+ s := &StoreCallback{cb}
storeCallbacks[s] = true
return s
}
-func UnregisterStoreChangeCallback(cb *storeCallback) {
+func (cb *StoreCallback) Unregister() {
delete(storeCallbacks, cb)
}