Documentation ¶
Overview ¶
* swireguard package is wireguard on steroids super-wireguard, smart-wireguar, Syntropy-wireguard This package is a helper for agent to configure (kernel or userspace) wireguard tunnels It also collects peer status, monitores latency, and other releated work *
Index ¶
- Constants
- type InterfaceInfo
- type PeerInfo
- type PeerStats
- type Wireguard
- func (wg *Wireguard) AddPeer(pi *PeerInfo) error
- func (wg *Wireguard) Apply() (allowedIPs []netip.Prefix, err error)
- func (wg *Wireguard) Close() error
- func (wg *Wireguard) CreateInterface(ii *InterfaceInfo) error
- func (wg *Wireguard) Device(ifname string) *InterfaceInfo
- func (wg *Wireguard) Devices() []*InterfaceInfo
- func (wg *Wireguard) Flush()
- func (wg *Wireguard) LogInfo()
- func (wg *Wireguard) PeerStatsInit()
- func (wg *Wireguard) PeerStatsUpdate()
- func (wg *Wireguard) RemoveInterface(ii *InterfaceInfo) error
- func (wg *Wireguard) RemovePeer(pi *PeerInfo) error
Constants ¶
View Source
const KeepAlliveDuration = 15 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterfaceInfo ¶
type InterfaceInfo struct { IfName string PublicKey string IP netip.Addr Port int // contains filtered or unexported fields }
func (*InterfaceInfo) Peers ¶
func (ii *InterfaceInfo) Peers() []*PeerInfo
type Wireguard ¶
type Wireguard struct { // If true - remove resident non-syntropy created tunnels RemoveNonSyntropyInterfaces bool sync.RWMutex // contains filtered or unexported fields }
func (*Wireguard) Apply ¶
Apply function setups cached WG configuration, and cleans up resident configuration
func (*Wireguard) CreateInterface ¶
func (wg *Wireguard) CreateInterface(ii *InterfaceInfo) error
func (*Wireguard) Device ¶
func (wg *Wireguard) Device(ifname string) *InterfaceInfo
func (*Wireguard) Devices ¶
func (wg *Wireguard) Devices() []*InterfaceInfo
func (*Wireguard) PeerStatsInit ¶
func (wg *Wireguard) PeerStatsInit()
func (*Wireguard) PeerStatsUpdate ¶
func (wg *Wireguard) PeerStatsUpdate()
func (*Wireguard) RemoveInterface ¶
func (wg *Wireguard) RemoveInterface(ii *InterfaceInfo) error
func (*Wireguard) RemovePeer ¶
RemovePeer removes a peer from Wireguard interface and internal cache
Click to show internal directories.
Click to hide internal directories.