platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
26
selective-vpn-api/app/routes_cache_helpers_meta.go
Normal file
26
selective-vpn-api/app/routes_cache_helpers_meta.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func loadRoutesClearCacheMeta() (routesClearCacheMeta, error) {
|
||||
data, err := os.ReadFile(routesCacheMeta)
|
||||
if err != nil {
|
||||
return routesClearCacheMeta{}, err
|
||||
}
|
||||
var meta routesClearCacheMeta
|
||||
if err := json.Unmarshal(data, &meta); err != nil {
|
||||
return routesClearCacheMeta{}, err
|
||||
}
|
||||
return meta, nil
|
||||
}
|
||||
|
||||
func ifaceOrDash(iface string) string {
|
||||
if strings.TrimSpace(iface) == "" {
|
||||
return "-"
|
||||
}
|
||||
return iface
|
||||
}
|
||||
Reference in New Issue
Block a user