config

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DumpSignalChan - channel to signal dump proxy conns info
	DumpSignalChan = make(chan struct{}, 5)
)

Functions

func DumpProxyConnsInfo added in v0.20.5

func DumpProxyConnsInfo(ctx context.Context, wg *sync.WaitGroup)

func InitializeCfg

func InitializeCfg()

InitializeCfg - intializes all the variables and sets defaults

func Reset

func Reset()

Reset - resets Config // to be called only when proxy is shutting down

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config - struct for proxy config

func GetCfg

func GetCfg() *Config

GetCfg - fethes Config

func (*Config) DeletePeerHash

func (c *Config) DeletePeerHash(peerKey string)

Config.DeletePeerHash - deletes peer by its pubkey hash from config

func (*Config) DeletePeerTurnCfg added in v0.19.0

func (c *Config) DeletePeerTurnCfg(peerKey string)

Config.DeleteTurnCfg - deletes the turn config

func (*Config) Dump added in v0.18.6

func (c *Config) Dump()

Config.Dump - dumps the proxy peer connections information

func (*Config) GetAllProxyPeers

func (c *Config) GetAllProxyPeers() models.PeerConnMap

Config.GetAllProxyPeers - fetches all peers in the network

func (*Config) GetAllTurnPeersCfg added in v0.19.0

func (c *Config) GetAllTurnPeersCfg() map[string]models.TurnPeerCfg

Config.GetAllTurnPeersCfg - fetches all peers using turn

func (*Config) GetDevicePubKey

func (c *Config) GetDevicePubKey() (publicKey wgtypes.Key)

Config.GetDevicePubKey - fetches device public key

func (*Config) GetIface

func (c *Config) GetIface() *wg.WGIface

Config.GetIface - gets the interface config

func (*Config) GetIfaceDevice

func (c *Config) GetIfaceDevice() wgtypes.Device

Config.GetGetIfaceDeviceIface - gets the wg device value

func (*Config) GetInterfaceListenPort

func (c *Config) GetInterfaceListenPort() (port int)

Config.GetInterfaceListenPort - fetches interface listen port from config

func (*Config) GetPeer

func (c *Config) GetPeer(peerPubKey string) (models.Conn, bool)

Config.GetPeer - fetches the peer by network and pubkey

func (*Config) GetPeerInfoByHash

func (c *Config) GetPeerInfoByHash(peerKeyHash string) (models.RemotePeer, bool)

Config.GetPeerInfoByHash - fetches the peerInfo by its pubKey hash

func (*Config) GetPeerTurnCfg added in v0.19.0

func (c *Config) GetPeerTurnCfg(peerKey string) (t models.TurnPeerCfg, ok bool)

Config.GetPeerTurnCfg - gets the peer turn cfg

func (*Config) GetTurnCfg added in v0.19.0

func (c *Config) GetTurnCfg() (t *models.TurnCfg)

Config.GetTurnCfg - gets the turn config

func (*Config) IsIfaceNil

func (c *Config) IsIfaceNil() bool

Config.IsIfaceNil - checks if ifconfig is nil in the memory config

func (*Config) RemovePeer

func (c *Config) RemovePeer(peerPubKey string)

Config.RemovePeer - removes the peer from the network peer config

func (*Config) ResetPeer

func (c *Config) ResetPeer(peerKey string)

Config.ResetPeer - resets the peer connection to proxy

func (*Config) SavePeer

func (c *Config) SavePeer(connConf *models.Conn)

Config.SavePeer - saves peer to the config

func (*Config) SavePeerByHash

func (c *Config) SavePeerByHash(peerInfo *models.RemotePeer)

Config.SavePeerByHash - saves peer by its publicKey hash to the config

func (*Config) SetIface

func (c *Config) SetIface(iface *wg.WGIface)

Config.SetIface - sets the iface value in the config

func (*Config) SetPeerTurnCfg added in v0.19.0

func (c *Config) SetPeerTurnCfg(peerKey string, t models.TurnPeerCfg)

Config.SetPeerTurnCfg - sets the peer turn cfg

func (*Config) SetTurnCfg added in v0.19.0

func (c *Config) SetTurnCfg(t *models.TurnCfg)

Config.SetTurnCfg - sets the turn config

func (*Config) UpdatePeer

func (c *Config) UpdatePeer(updatedPeer *models.Conn)

Config.UpdatePeer - updates peer by network

func (*Config) UpdatePeerTurnAddr added in v0.19.0

func (c *Config) UpdatePeerTurnAddr(peerKey string, addr string)

func (*Config) UpdatePeerTurnCfg added in v0.19.0

func (c *Config) UpdatePeerTurnCfg(peerKey string, t models.TurnPeerCfg)

Config.UpdatePeerTurnCfg - updates the peer turn cfg

Jump to

Keyboard shortcuts

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