p2p

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentPublicIP

func CurrentPublicIP() (string, error)

CurrentPublicIP Get Current Public IP address

func ForwardPort

func ForwardPort(port int) error

Port forwarding to the router

func GetCurrentIPV6

func GetCurrentIPV6() (string, error)

GetCurrentIPV6 gets the current IPV6 address based on the interface specified in the config file

func Ip4or6

func Ip4or6(s string) string

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 PrintIpTable

func PrintIpTable() error

PrintIpTable Print Ip table data for Cli

func UnForwardPort

func UnForwardPort(port int) error

UnForwardPort from router

func ViewNetworkInterface

func ViewNetworkInterface() error

ViewNetworkInterface This function is created to view the network interfaces available

Types

type IP

type IP struct {
	Query string
}

type IpAddress

type IpAddress struct {
	Name                 string        `json:"Name"`
	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"`
	NAT                  string        `json:"NAT"`
	EscapeImplementation string        `json:"EscapeImplementation"`
	CustomInformation    []byte
}

func (*IpAddress) DownloadSpeed

func (s *IpAddress) DownloadSpeed() error

Download Speed

func (*IpAddress) PingTest

func (s *IpAddress) PingTest() error

PingTest executes test to measure latency

func (*IpAddress) UploadSpeed

func (s *IpAddress) UploadSpeed() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL