controller

package
v0.71.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	EphemeralPeersManager ephemeral.Manager
	// contains filtered or unexported fields
}

func NewController

func NewController(ctx context.Context, store store.Store, metrics telemetry.AppMetrics, peersUpdateManager network_map.PeersUpdateManager, requestBuffer account.RequestBuffer, integratedPeerValidator integrated_validator.IntegratedValidator, settingsManager settings.Manager, dnsDomain string, proxyController port_forwarding.Controller, ephemeralPeersManager ephemeral.Manager, config *config.Config) *Controller

func (*Controller) BufferUpdateAccountPeers

func (c *Controller) BufferUpdateAccountPeers(ctx context.Context, accountID string, reason types.UpdateReason) error

func (*Controller) CountStreams added in v0.60.5

func (c *Controller) CountStreams() int

func (*Controller) DisconnectPeers

func (c *Controller) DisconnectPeers(ctx context.Context, accountId string, peerIDs []string)

func (*Controller) GetDNSDomain

func (c *Controller) GetDNSDomain(settings *types.Settings) string

GetDNSDomain returns the configured dnsDomain

func (*Controller) GetNetworkMap

func (c *Controller) GetNetworkMap(ctx context.Context, peerID string) (*types.NetworkMap, error)

GetNetworkMap returns Network map for a given peer (omits original peer from the Peers result)

func (*Controller) GetValidatedPeerWithMap

func (c *Controller) GetValidatedPeerWithMap(ctx context.Context, isRequiresApproval bool, accountID string, peer *nbpeer.Peer) (*nbpeer.Peer, *types.NetworkMap, []*posture.Checks, int64, error)

func (*Controller) OnPeerConnected added in v0.60.5

func (c *Controller) OnPeerConnected(ctx context.Context, accountID string, peerID string) (chan *network_map.UpdateMessage, error)

func (*Controller) OnPeerDisconnected added in v0.60.5

func (c *Controller) OnPeerDisconnected(ctx context.Context, accountID string, peerID string)

func (*Controller) OnPeersAdded added in v0.60.5

func (c *Controller) OnPeersAdded(ctx context.Context, accountID string, peerIDs []string) error

func (*Controller) OnPeersDeleted added in v0.60.5

func (c *Controller) OnPeersDeleted(ctx context.Context, accountID string, peerIDs []string) error

func (*Controller) OnPeersUpdated added in v0.60.5

func (c *Controller) OnPeersUpdated(ctx context.Context, accountID string, peerIDs []string) error

func (*Controller) StartWarmup

func (c *Controller) StartWarmup(ctx context.Context)

func (*Controller) TrackEphemeralPeer added in v0.64.1

func (c *Controller) TrackEphemeralPeer(ctx context.Context, peer *nbpeer.Peer)

func (*Controller) UpdateAccountPeer

func (c *Controller) UpdateAccountPeer(ctx context.Context, accountId string, peerId string) error

func (*Controller) UpdateAccountPeers

func (c *Controller) UpdateAccountPeers(ctx context.Context, accountID string, reason types.UpdateReason) error

UpdatePeers updates all peers that belong to an account. Should be called when changes have to be synced to peers.

type Repository

type Repository interface {
	GetAccountNetwork(ctx context.Context, accountID string) (*types.Network, error)
	GetAccountPeers(ctx context.Context, accountID string) ([]*peer.Peer, error)
	GetAccountByPeerID(ctx context.Context, peerID string) (*types.Account, error)
	GetPeersByIDs(ctx context.Context, accountID string, peerIDs []string) (map[string]*peer.Peer, error)
	GetPeerByID(ctx context.Context, accountID string, peerID string) (*peer.Peer, error)
	GetAccountZones(ctx context.Context, accountID string) ([]*zones.Zone, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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