controller

package
v0.60.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: BSD-3-Clause, AGPL-3.0 Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// 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, config *config.Config) *Controller

func (*Controller) BufferUpdateAccountPeers

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

func (*Controller) DeletePeer

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

func (*Controller) DisconnectPeers

func (c *Controller) DisconnectPeers(ctx context.Context, 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) IsConnected

func (c *Controller) IsConnected(peerID string) bool

func (*Controller) OnPeerAdded

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

func (*Controller) OnPeerDeleted

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

func (*Controller) OnPeerUpdated

func (c *Controller) OnPeerUpdated(accountId string, peer *nbpeer.Peer)

func (*Controller) RecalculateNetworkMapCache

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

func (*Controller) StartWarmup

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

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) error

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

func (*Controller) UpdatePeerInNetworkMapCache

func (c *Controller) UpdatePeerInNetworkMapCache(accountId string, peer *nbpeer.Peer)

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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