mirror of
https://github.com/luscis/openlan.git
synced 2025-10-06 17:17:00 +08:00
fea: database: json schema
This commit is contained in:
2
dist/script/update.sh
vendored
2
dist/script/update.sh
vendored
@@ -12,7 +12,7 @@ set -ex
|
|||||||
|
|
||||||
## Update your DDNS
|
## Update your DDNS
|
||||||
export VERSION=v6
|
export VERSION=v6
|
||||||
names=$(openlan na ls | grep -w 'Name:' | sed 's/Name://g')
|
names=$(openlan na ls | grep -w 'name:' | sed 's/name://g')
|
||||||
for name in $names; do
|
for name in $names; do
|
||||||
openlan name add --name $name
|
openlan name add --name $name
|
||||||
done
|
done
|
||||||
|
@@ -1,55 +1,55 @@
|
|||||||
package database
|
package database
|
||||||
|
|
||||||
type Switch struct {
|
type Switch struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Protocol string `ovsdb:"protocol"`
|
Protocol string `ovsdb:"protocol" json:"protocol"`
|
||||||
Listen int `ovsdb:"listen"`
|
Listen int `ovsdb:"listen" json:"listen"`
|
||||||
OtherConfig map[string]string `ovsdb:"other_config" yaml:"other_config"`
|
OtherConfig map[string]string `ovsdb:"other_config" json:"other_config"`
|
||||||
VirtualNetworks []string `ovsdb:"virtual_networks" yaml:"virtual_networks"`
|
VirtualNetworks []string `ovsdb:"virtual_networks" json:"virtual_networks"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type VirtualNetwork struct {
|
type VirtualNetwork struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Name string `ovsdb:"name"`
|
Name string `ovsdb:"name" json:"name"`
|
||||||
Provider string `ovsdb:"provider"`
|
Provider string `ovsdb:"provider" json:"provider"`
|
||||||
Bridge string `ovsdb:"bridge"`
|
Bridge string `ovsdb:"bridge" json:"bridge"`
|
||||||
Address string `ovsdb:"address"`
|
Address string `ovsdb:"address" json:"address"`
|
||||||
OtherConfig map[string]string `ovsdb:"other_config" yaml:"other_config"`
|
OtherConfig map[string]string `ovsdb:"other_config" json:"other_config"`
|
||||||
RemoteLinks []string `ovsdb:"remote_links" yaml:"remote_links"`
|
RemoteLinks []string `ovsdb:"remote_links" json:"remote_links"`
|
||||||
LocalLinks []string `ovsdb:"local_links" yaml:"local_links"`
|
LocalLinks []string `ovsdb:"local_links" json:"local_links"`
|
||||||
OpenVPN *string `ovsdb:"open_vpn" yaml:"open_vpn"`
|
OpenVPN *string `ovsdb:"open_vpn" json:"open_vpn"`
|
||||||
PrefixRoutes []string `ovsdb:"prefix_routes" yaml:"prefix_routes"`
|
PrefixRoutes []string `ovsdb:"prefix_routes" json:"prefix_routes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type VirtualLink struct {
|
type VirtualLink struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Network string `ovsdb:"network"`
|
Network string `ovsdb:"network" json:"network"`
|
||||||
Connection string `ovsdb:"connection"`
|
Connection string `ovsdb:"connection" json:"connection"`
|
||||||
Device string `ovsdb:"device"`
|
Device string `ovsdb:"device" json:"device"`
|
||||||
OtherConfig map[string]string `ovsdb:"other_config" yaml:"other_config"`
|
OtherConfig map[string]string `ovsdb:"other_config" json:"other_config"`
|
||||||
Authentication map[string]string `ovsdb:"authentication" yaml:"authentication"`
|
Authentication map[string]string `ovsdb:"authentication" json:"authentication"`
|
||||||
LinkState string `ovsdb:"link_state" yaml:"link_state"`
|
LinkState string `ovsdb:"link_state" json:"link_state"`
|
||||||
Status map[string]string `ovsdb:"status" yaml:"status"`
|
Status map[string]string `ovsdb:"status" json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OpenVPN struct {
|
type OpenVPN struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Protocol string `ovsdb:"protocol"`
|
Protocol string `ovsdb:"protocol" json:"protocol"`
|
||||||
Listen int `ovsdb:"listen"`
|
Listen int `ovsdb:"listen" json:"listen"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NameCache struct {
|
type NameCache struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Name string `ovsdb:"name"`
|
Name string `ovsdb:"name" json:"name"`
|
||||||
Address string `ovsdb:"address"`
|
Address string `ovsdb:"address" json:"address"`
|
||||||
UpdateAt string `ovsdb:"update_at" yaml:"update_at"`
|
UpdateAt string `ovsdb:"update_at" json:"update_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrefixRoute struct {
|
type PrefixRoute struct {
|
||||||
UUID string `ovsdb:"_uuid"`
|
UUID string `ovsdb:"_uuid" json:"uuid"`
|
||||||
Network string `ovsdb:"network"`
|
Network string `ovsdb:"network" json:"network"`
|
||||||
Prefix string `ovsdb:"prefix"`
|
Prefix string `ovsdb:"prefix" json:"prefix"`
|
||||||
Source string `ovsdb:"source"`
|
Source string `ovsdb:"source" json:"source"`
|
||||||
Gateway string `ovsdb:"gateway"`
|
Gateway string `ovsdb:"gateway" json:"gateway"`
|
||||||
Mode string `ovsdb:"mode"`
|
Mode string `ovsdb:"mode" json:"mode"`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user