Versions in this module Expand all Collapse all v0 v0.4.0 Sep 4, 2024 v0.3.6 Sep 2, 2024 Changes in this version + const DefaultConnectionTimeoutMs + const MaxConcurrentConnection + const PacketQueueSizePerConnection + var ExeDirPath string + type Config struct + LogLevel int + PrivateKeyBase64 string + type KnockResource struct + AuthServiceId string + ResourceId string + ServerAddr string + func (res *KnockResource) Id() string + type KnockTarget struct + LastKnockSuccessTime time.Time + ServerPeer *nhp.UdpPeer + func (kt *KnockTarget) Server() *nhp.UdpPeer + func (kt *KnockTarget) SetResource(res *KnockResource) + func (kt *KnockTarget) SetServer(peer *nhp.UdpPeer) + type KnockUser struct + OrganizationId string + UserData map[string]any + UserId string + type Peers struct + Servers []*nhp.UdpPeer + type Resources struct + Resources []*KnockResource + type UdpAgent struct + func (a *UdpAgent) AddResource(res *KnockResource) error + func (a *UdpAgent) AddServer(server *nhp.UdpPeer) + func (a *UdpAgent) ExitKnockRequest(res *KnockTarget) (ackMsg *common.ServerKnockAckMsg, err error) + func (a *UdpAgent) FindServerPeerFromResource(res *KnockResource) *nhp.UdpPeer + func (a *UdpAgent) HandleCookieMessage(ppd *nhp.PacketParserData) bool + func (a *UdpAgent) IsRunning() bool + func (a *UdpAgent) Knock(res *KnockTarget) (ackMsg *common.ServerKnockAckMsg, err error) + func (a *UdpAgent) ListResource(target *KnockTarget) (lrtMsg *common.ServerListResultMsg, err error) + func (a *UdpAgent) RegisterPublicKey(otp string, target *KnockTarget) (rakMsg *common.ServerRegisterAckMsg, err error) + func (a *UdpAgent) RemoveResource(aspId string, resId string) + func (a *UdpAgent) RemoveServer(serverKey string) + func (a *UdpAgent) RequestOtp(target *KnockTarget) error + func (a *UdpAgent) ResolvePeer(peer *nhp.UdpPeer) (*nhp.UdpPeer, net.Addr) + func (a *UdpAgent) SendPacket(pkt *nhp.UdpPacket, conn *UdpConn) (n int, err error) + func (a *UdpAgent) SetCheckResults(results map[string]any) + func (a *UdpAgent) SetDeviceId(devId string) + func (a *UdpAgent) SetKnockUser(usrId string, orgId string, userData map[string]any) + func (a *UdpAgent) Start(dirPath string, logLevel int) (err error) + func (a *UdpAgent) StartKnockLoop() int + func (a *UdpAgent) Stop() + func (a *UdpAgent) StopConfigWatch() + func (a *UdpAgent) StopKnockLoop() + type UdpConn struct + ConnData *nhp.ConnectionData + func (c *UdpConn) Close()