controller

package
v0.74.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 33 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 {
	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) BufferUpdateAffectedPeers added in v0.73.0

func (c *Controller) BufferUpdateAffectedPeers(ctx context.Context, accountID string, peerIDs []string, reason types.UpdateReason) error

BufferUpdateAffectedPeers accumulates peer IDs and flushes them after the buffer interval.

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, peerID string) (*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, affectedPeerIDs []string) error

func (*Controller) OnPeersDeleted added in v0.60.5

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

func (*Controller) OnPeersUpdated added in v0.60.5

func (c *Controller) OnPeersUpdated(ctx context.Context, accountID string, peerIDs []string, affectedPeerIDs []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.

func (*Controller) UpdateAffectedPeers added in v0.73.0

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

UpdateAffectedPeers updates only the specified peers that belong to an account.

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)
	// SynthesizeAgentNetworkServices returns the in-memory reverse-proxy
	// services synthesised from the account's agent-network provider/policy
	// state. Empty for accounts without agent-network providers.
	SynthesizeAgentNetworkServices(ctx context.Context, accountID string) ([]*service.Service, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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