Help us shape the future of Go! Take the 2026 Go Developer Survey

controller

package
v0.81.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Overview

Package controller is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeForwarderPortFromData added in v0.78.0

func ComputeForwarderPortFromData(peers map[string]*nmdata.Peer, requiredVersion string) int64

func IPv6AllowedPeersFromData added in v0.78.0

func IPv6AllowedPeersFromData(nmData *networkmap.NetworkMapData) map[string]struct{}

func NetworkMapFromData added in v0.78.0

func NetworkMapFromData(ctx context.Context, nmData *networkmap.NetworkMapData, peerID string, peersCustomZone nmdata.CustomZone, metrics *telemetry.AccountManagerMetrics) *types.NetworkMap

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, ephemeralPeersManager ephemeral.Manager, config *config.Config, nmdataStore *networkmapdb.NetworkMapDBStoreImpl) *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) GetValidatedPeerWithComponents added in v0.75.0

func (c *Controller) GetValidatedPeerWithComponents(ctx context.Context, isRequiresApproval bool, accountID string, peer *nbpeer.Peer) (*nbpeer.Peer, *types.NetworkMapComponents, []*nmdata.PostureChecks, int64, error)

GetValidatedPeerWithComponents is the components-format counterpart of GetValidatedPeerWithMap. It returns raw NetworkMapComponents for capable peers, which the gRPC layer encodes into the wire envelope. Callers must gate on capability themselves before dispatching here — this method does NOT branch on it.

func (*Controller) GetValidatedPeerWithMap

func (c *Controller) GetValidatedPeerWithMap(ctx context.Context, isRequiresApproval bool, accountID string, peerID string) (*types.NetworkMap, []*nmdata.PostureChecks, 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, session chan *network_map.UpdateMessage) bool

OnPeerDisconnected closes the session's updates channel and schedules an ephemeral peer for cleanup. It returns false without touching anything when a newer session owns the peer. A nil session closes any registered channel.

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 MockRepository added in v0.78.0

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

MockRepository is a mock of Repository interface.

func NewMockRepository added in v0.78.0

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) EXPECT added in v0.78.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRepository) GetAccountByPeerID added in v0.78.0

func (m *MockRepository) GetAccountByPeerID(ctx context.Context, peerID string) (*types.Account, error)

GetAccountByPeerID mocks base method.

func (*MockRepository) GetAccountNetwork added in v0.78.0

func (m *MockRepository) GetAccountNetwork(ctx context.Context, accountID string) (*types.Network, error)

GetAccountNetwork mocks base method.

func (*MockRepository) GetAccountPeers added in v0.78.0

func (m *MockRepository) GetAccountPeers(ctx context.Context, accountID string) ([]*peer.Peer, error)

GetAccountPeers mocks base method.

func (*MockRepository) GetAccountServices added in v0.81.0

func (m *MockRepository) GetAccountServices(ctx context.Context, accountID string) ([]*service.Service, error)

GetAccountServices mocks base method.

func (*MockRepository) GetAccountZones added in v0.78.0

func (m *MockRepository) GetAccountZones(ctx context.Context, accountID string) ([]*zones.Zone, error)

GetAccountZones mocks base method.

func (*MockRepository) GetPeerByID added in v0.78.0

func (m *MockRepository) GetPeerByID(ctx context.Context, accountID, peerID string) (*peer.Peer, error)

GetPeerByID mocks base method.

func (*MockRepository) GetPeersByIDs added in v0.78.0

func (m *MockRepository) GetPeersByIDs(ctx context.Context, accountID string, peerIDs []string) (map[string]*peer.Peer, error)

GetPeersByIDs mocks base method.

func (*MockRepository) SynthesizeAgentNetworkServices added in v0.78.0

func (m *MockRepository) SynthesizeAgentNetworkServices(ctx context.Context, accountID string) ([]*service.Service, error)

SynthesizeAgentNetworkServices mocks base method.

type MockRepositoryMockRecorder added in v0.78.0

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) GetAccountByPeerID added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetAccountByPeerID(ctx, peerID any) *gomock.Call

GetAccountByPeerID indicates an expected call of GetAccountByPeerID.

func (*MockRepositoryMockRecorder) GetAccountNetwork added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetAccountNetwork(ctx, accountID any) *gomock.Call

GetAccountNetwork indicates an expected call of GetAccountNetwork.

func (*MockRepositoryMockRecorder) GetAccountPeers added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetAccountPeers(ctx, accountID any) *gomock.Call

GetAccountPeers indicates an expected call of GetAccountPeers.

func (*MockRepositoryMockRecorder) GetAccountServices added in v0.81.0

func (mr *MockRepositoryMockRecorder) GetAccountServices(ctx, accountID any) *gomock.Call

GetAccountServices indicates an expected call of GetAccountServices.

func (*MockRepositoryMockRecorder) GetAccountZones added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetAccountZones(ctx, accountID any) *gomock.Call

GetAccountZones indicates an expected call of GetAccountZones.

func (*MockRepositoryMockRecorder) GetPeerByID added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetPeerByID(ctx, accountID, peerID any) *gomock.Call

GetPeerByID indicates an expected call of GetPeerByID.

func (*MockRepositoryMockRecorder) GetPeersByIDs added in v0.78.0

func (mr *MockRepositoryMockRecorder) GetPeersByIDs(ctx, accountID, peerIDs any) *gomock.Call

GetPeersByIDs indicates an expected call of GetPeersByIDs.

func (*MockRepositoryMockRecorder) SynthesizeAgentNetworkServices added in v0.78.0

func (mr *MockRepositoryMockRecorder) SynthesizeAgentNetworkServices(ctx, accountID any) *gomock.Call

SynthesizeAgentNetworkServices indicates an expected call of SynthesizeAgentNetworkServices.

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)
	GetAccountServices(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