service

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthStatus

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

func NewAuthStatus

func NewAuthStatus(p2pService P2p, conf *config.Config, eventbus awlevent.Bus) *AuthStatus

func (*AuthStatus) AddPeer

func (s *AuthStatus) AddPeer(ctx context.Context, peerID peer.ID, name, alias string, confirmed bool, ipAddr string) error

func (*AuthStatus) AuthStreamHandler

func (s *AuthStatus) AuthStreamHandler(stream network.Stream)

func (*AuthStatus) BackgroundExchangeStatusInfo

func (s *AuthStatus) BackgroundExchangeStatusInfo(ctx context.Context)

func (*AuthStatus) BackgroundRetryAuthRequests

func (s *AuthStatus) BackgroundRetryAuthRequests(ctx context.Context)

func (*AuthStatus) BlockPeer

func (s *AuthStatus) BlockPeer(peerID peer.ID, name string)

func (*AuthStatus) ExchangeNewStatusInfo

func (s *AuthStatus) ExchangeNewStatusInfo(ctx context.Context, remotePeerID peer.ID, knownPeer config.KnownPeer) error

func (*AuthStatus) ExchangeStatusInfoWithAllKnownPeers

func (s *AuthStatus) ExchangeStatusInfoWithAllKnownPeers(ctx context.Context)

func (*AuthStatus) GetIngoingAuthRequests

func (s *AuthStatus) GetIngoingAuthRequests() map[string]protocol.AuthPeer

func (*AuthStatus) SendAuthRequest

func (s *AuthStatus) SendAuthRequest(ctx context.Context, peerID peer.ID, req protocol.AuthPeer) error

func (*AuthStatus) StatusStreamHandler

func (s *AuthStatus) StatusStreamHandler(stream network.Stream)

type P2p

type P2p interface {
	ConnectPeer(ctx context.Context, peerID peer.ID) error
	IsConnected(peerID peer.ID) bool
	NewStream(ctx context.Context, id peer.ID, proto libp2pProtocol.ID) (network.Stream, error)
	NewStreamWithDedicatedConn(ctx context.Context, id peer.ID, proto libp2pProtocol.ID) (network.Stream, error)
	SubscribeConnectionEvents(onConnected, onDisconnected func(network.Network, network.Conn))
	RecordPeerLatency(id peer.ID, rtt time.Duration)
}

type SOCKS5 added in v0.12.0

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

func NewSOCKS5 added in v0.12.0

func NewSOCKS5(p2pService P2p, conf *config.Config) (*SOCKS5, error)

func (*SOCKS5) Close added in v0.12.0

func (s *SOCKS5) Close()

func (*SOCKS5) ListAvailableProxies added in v0.12.0

func (s *SOCKS5) ListAvailableProxies() []entity.AvailableProxy

func (*SOCKS5) ProxyStreamHandler added in v0.12.0

func (s *SOCKS5) ProxyStreamHandler(stream network.Stream)

func (*SOCKS5) ServeConns added in v0.12.0

func (s *SOCKS5) ServeConns(ctx context.Context)

func (*SOCKS5) SetProxyPeerID added in v0.12.0

func (s *SOCKS5) SetProxyPeerID(peerID string)

func (*SOCKS5) SetProxyingLocalhostEnabled added in v0.12.0

func (s *SOCKS5) SetProxyingLocalhostEnabled(enabled bool)

SetProxyingLocalhostEnabled is created for tests and not intended for real usage.

type Tunnel

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

func NewTunnel

func NewTunnel(p2pService P2p, device *vpn.Device, conf *config.Config) *Tunnel

func (*Tunnel) Close

func (t *Tunnel) Close()

func (*Tunnel) HandleReadPackets added in v0.15.0

func (t *Tunnel) HandleReadPackets(packets []*vpn.Packet)

HandleReadPackets for successfully handled packets it sets packet in slice as nil

func (*Tunnel) RefreshPeersList

func (t *Tunnel) RefreshPeersList()

func (*Tunnel) StreamHandler

func (t *Tunnel) StreamHandler(stream network.Stream)

type VpnPeer

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

func NewVpnPeer added in v0.15.0

func NewVpnPeer(peerID peer.ID, localIP net.IP) *VpnPeer

func (*VpnPeer) Close

func (vp *VpnPeer) Close(t *Tunnel)

func (*VpnPeer) Start

func (vp *VpnPeer) Start(t *Tunnel)

TODO: remove Tunnel from VpnPeer dependencies

Jump to

Keyboard shortcuts

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