Documentation
¶
Index ¶
- func CurrentPublicIP() (string, error)
- func ForwardPort(port int) error
- func GetCurrentIPV6() (string, error)
- func Ip4or6(s string) string
- func LocalSpeedTestIpTable() error
- func PrintIpTable() error
- func UnForwardPort(port int) error
- func ViewNetworkInterface() error
- type IP
- type IpAddress
- type IpAddresses
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentPublicIP ¶
CurrentPublicIP Get Current Public IP address
func GetCurrentIPV6 ¶
GetCurrentIPV6 gets the current IPV6 address based on the interface specified in the config file
func Ip4or6 ¶
Ip4or6 Helper function to check if the IP address is IPV4 or IPV6 (https://socketloop.com/tutorials/golang-check-if-ip-address-is-version-4-or-6)
func LocalSpeedTestIpTable ¶
func LocalSpeedTestIpTable() error
LocalSpeedTestIpTable Runs speed test in iptables locally only
func ViewNetworkInterface ¶
func ViewNetworkInterface() error
ViewNetworkInterface This function is created to view the network interfaces available
Types ¶
type IpAddress ¶
type IpAddress struct { Ipv4 string `json:"ipv4"` Ipv6 string `json:"ipv6"` Latency time.Duration `json:"latency"` Download float64 `json:"download"` Upload float64 `json:"upload"` ServerPort string `json:"serverport"` }
func (*IpAddress) UploadSpeed ¶
type IpAddresses ¶
type IpAddresses struct {
IpAddress []IpAddress `json:"ip_address"`
}
func ReadIpTable ¶
func ReadIpTable() (*IpAddresses, error)
ReadIpTable Read data from Ip tables from json file
func (*IpAddresses) RemoveDuplicates ¶
func (table *IpAddresses) RemoveDuplicates() error
RemoveDuplicates This is a temporary fix current functions failing to remove Duplicate IP addresses from local IP table
func (*IpAddresses) SpeedTest ¶
func (ip *IpAddresses) SpeedTest() error
SpeedTest Runs a speed test and does updates IP tables accordingly
func (*IpAddresses) SpeedTestUpdatedIPTable ¶
func (ip *IpAddresses) SpeedTestUpdatedIPTable() error
SpeedTestUpdatedIPTable Called when ip tables from httpclient/server is also passed on
func (*IpAddresses) WriteIpTable ¶
func (i *IpAddresses) WriteIpTable() error
WriteIpTable Write to IP table json file