disabling cache; it's not really necessary.
This commit is contained in:
@@ -9,10 +9,13 @@ import (
|
||||
`r00t2.io/gobroke/conf`
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
tunCfg *conf.Config
|
||||
myAddr net.IP
|
||||
}
|
||||
/*
|
||||
TunPrefix is derived from netip.Prefix.
|
||||
Because even though -- EVEN THOUGH -- it has a TextMarshaler and TextUnmarshaler interface,
|
||||
it fails to work properly because Golang.
|
||||
https://github.com/jmoiron/sqlx/issues/957
|
||||
*/
|
||||
type TunPrefix netip.Prefix
|
||||
|
||||
type TunnelList struct {
|
||||
XMLName xml.Name `json:"-" xml:"tunnels" yaml:"-"`
|
||||
@@ -20,30 +23,27 @@ type TunnelList struct {
|
||||
}
|
||||
|
||||
type Tunnel struct {
|
||||
XMLName xml.Name `json:"-" xml:"tunnel" yaml:"-"`
|
||||
ID uint `json:"id" xml:"id,attr" yaml:"ID" db:"tun_id"`
|
||||
Description string `json:"desc" xml:"description" yaml:"Description" db:"desc"`
|
||||
ServerIPv4 net.IP `json:"tgt_v4" xml:"serverv4" yaml:"IPv4 Tunnel Target" db:"server_v4"`
|
||||
ClientIPv4 net.IP `json:"client_v4" xml:"clientv4" yaml:"Configured IPv4 Client Address" db:"current_client_v4"`
|
||||
ServerIPv6 net.IP `json:"server_v6" xml:"serverv6" yaml:"IPv6 Endpoint" db:"tunnel_server_v6"`
|
||||
ClientIPv6 net.IP `json:"client_v6" xml:"clientv6" yaml:"IPv6 Tunnel Client Address" db:"tunnel_client_v6"`
|
||||
Routed64 netip.Prefix `json:"routed_64" xml:"routed64" yaml:"Routed /64" db:"prefix_64"`
|
||||
Routed48 *netip.Prefix `json:"routed_48,omitempty" xml:"routed48,omitempty" yaml:"Routed /48,omitempty" db:"prefix_48"`
|
||||
RDNS1 *string `json:"rdns_1,omitempty" xml:"rdns1,omitempty" yaml:"RDNS #1,omitempty" db:"rdns_1"`
|
||||
RDNS2 *string `json:"rdns_2,omitempty" xml:"rdns2,omitempty" yaml:"RDNS #2,omitempty" db:"rdns_2"`
|
||||
RDNS3 *string `json:"rdns_3,omitempty" xml:"rdns3,omitempty" yaml:"RDNS #3,omitempty" db:"rdns_3"`
|
||||
RDNS4 *string `json:"rdns_4,omitempty" xml:"rdns4,omitempty" yaml:"RDNS #4,omitempty" db:"rdns_4"`
|
||||
RDNS5 *string `json:"rdns_5,omitempty" xml:"rdns5,omitempty" yaml:"RDNS #5,omitempty" db:"rdns_5"`
|
||||
client *Client
|
||||
heClient *resty.Client
|
||||
XMLName xml.Name `json:"-" xml:"tunnel" yaml:"-"`
|
||||
ID uint `json:"id" xml:"id,attr" yaml:"ID" db:"tun_id"`
|
||||
Description string `json:"desc" xml:"description" yaml:"Description" db:"desc"`
|
||||
ServerIPv4 net.IP `json:"tgt_v4" xml:"serverv4" yaml:"IPv4 Tunnel Target" db:"server_v4"`
|
||||
ClientIPv4 net.IP `json:"client_v4" xml:"clientv4" yaml:"Configured IPv4 Client Address" db:"current_client_v4"`
|
||||
ServerIPv6 net.IP `json:"server_v6" xml:"serverv6" yaml:"IPv6 Endpoint" db:"tunnel_server_v6"`
|
||||
ClientIPv6 net.IP `json:"client_v6" xml:"clientv6" yaml:"IPv6 Tunnel Client Address" db:"tunnel_client_v6"`
|
||||
Routed64 TunPrefix `json:"routed_64" xml:"routed64" yaml:"Routed /64" db:"prefix_64"`
|
||||
Routed48 *TunPrefix `json:"routed_48,omitempty" xml:"routed48,omitempty" yaml:"Routed /48,omitempty" db:"prefix_48"`
|
||||
RDNS1 *string `json:"rdns_1,omitempty" xml:"rdns1,omitempty" yaml:"RDNS #1,omitempty" db:"rdns_1"`
|
||||
RDNS2 *string `json:"rdns_2,omitempty" xml:"rdns2,omitempty" yaml:"RDNS #2,omitempty" db:"rdns_2"`
|
||||
RDNS3 *string `json:"rdns_3,omitempty" xml:"rdns3,omitempty" yaml:"RDNS #3,omitempty" db:"rdns_3"`
|
||||
RDNS4 *string `json:"rdns_4,omitempty" xml:"rdns4,omitempty" yaml:"RDNS #4,omitempty" db:"rdns_4"`
|
||||
RDNS5 *string `json:"rdns_5,omitempty" xml:"rdns5,omitempty" yaml:"RDNS #5,omitempty" db:"rdns_5"`
|
||||
tunCfg *conf.Tunnel
|
||||
client *resty.Client
|
||||
}
|
||||
|
||||
type FetchedIP struct {
|
||||
NewClientIPv4 net.IP `json:"new_client_v4" xml:"newClientv4,attr" yaml:"Evaluated IPv4 Client Address" db:"client_ip"`
|
||||
}
|
||||
|
||||
type FetchedTunnel struct {
|
||||
*Tunnel
|
||||
*FetchedIP
|
||||
type HTTPError struct {
|
||||
Code int `json:"code" xml:"code,attr" yaml:"Status Code"`
|
||||
CodeStr string `json:"code_str" xml:"code_str,attr" yaml:"Status Code (Detailed)"`
|
||||
Message *string `json:"message,omitempty" xml:",chardata" yaml:"Error Message,omitempty"`
|
||||
Resp *resty.Response `json:"-" xml:"-" yaml:"-"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user