network_map

package
v0.78.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package network_map is a generated GoMock package.

Index

Constants

View Source
const (
	DnsForwarderPort           = nbdns.ForwarderServerPort
	OldForwarderPort           = nbdns.ForwarderClientPort
	DnsForwarderPortMinVersion = "v0.59.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	UpdateAccountPeers(ctx context.Context, accountID string, reason types.UpdateReason) error
	UpdateAffectedPeers(ctx context.Context, accountID string, peerIDs []string) error
	BufferUpdateAffectedPeers(ctx context.Context, accountID string, peerIDs []string, reason types.UpdateReason) error
	UpdateAccountPeer(ctx context.Context, accountId string, peerId string) error
	BufferUpdateAccountPeers(ctx context.Context, accountID string, reason types.UpdateReason) error
	GetValidatedPeerWithMap(ctx context.Context, isRequiresApproval bool, accountID string, peerID string) (*types.NetworkMap, []*nmdata.PostureChecks, int64, error)
	GetValidatedPeerWithComponents(ctx context.Context, isRequiresApproval bool, accountID string, p *nbpeer.Peer) (*nbpeer.Peer, *types.NetworkMapComponents, *types.NetworkMap, []*nmdata.PostureChecks, int64, error)
	GetDNSDomain(settings *types.Settings) string
	StartWarmup(context.Context)
	GetNetworkMap(ctx context.Context, peerID string) (*types.NetworkMap, error)
	CountStreams() int

	OnPeersUpdated(ctx context.Context, accountId string, peerIDs []string, affectedPeerIDs []string) error
	OnPeersAdded(ctx context.Context, accountID string, peerIDs []string, affectedPeerIDs []string) error
	OnPeersDeleted(ctx context.Context, accountID string, peerIDs []string, affectedPeerIDs []string) error
	DisconnectPeers(ctx context.Context, accountId string, peerIDs []string)
	OnPeerConnected(ctx context.Context, accountID string, peerID string) (chan *UpdateMessage, error)
	OnPeerDisconnected(ctx context.Context, accountID string, peerID string)

	TrackEphemeralPeer(ctx context.Context, peer *nbpeer.Peer)
}

type MessageType added in v0.64.6

type MessageType int

MessageType indicates the type of update message for debouncing strategy

const (
	// MessageTypeNetworkMap represents network map updates (peers, routes, DNS, firewall)
	// These updates can be safely debounced - only the latest state matters
	MessageTypeNetworkMap MessageType = iota
	// MessageTypeControlConfig represents control/config updates (tokens, peer expiration)
	// These updates should not be dropped as they contain time-sensitive information
	MessageTypeControlConfig
)

type MockController

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

MockController is a mock of Controller interface.

func NewMockController

func NewMockController(ctrl *gomock.Controller) *MockController

NewMockController creates a new mock instance.

func (*MockController) BufferUpdateAccountPeers

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

BufferUpdateAccountPeers mocks base method.

func (*MockController) BufferUpdateAffectedPeers added in v0.73.0

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

BufferUpdateAffectedPeers mocks base method.

func (*MockController) CountStreams added in v0.60.5

func (m *MockController) CountStreams() int

CountStreams mocks base method.

func (*MockController) DisconnectPeers

func (m *MockController) DisconnectPeers(ctx context.Context, accountId string, peerIDs []string)

DisconnectPeers mocks base method.

func (*MockController) EXPECT

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

func (*MockController) GetDNSDomain

func (m *MockController) GetDNSDomain(settings *types.Settings) string

GetDNSDomain mocks base method.

func (*MockController) GetNetworkMap

func (m *MockController) GetNetworkMap(ctx context.Context, peerID string) (*types.NetworkMap, error)

GetNetworkMap mocks base method.

func (*MockController) GetValidatedPeerWithComponents added in v0.75.0

func (m *MockController) GetValidatedPeerWithComponents(ctx context.Context, isRequiresApproval bool, accountID string, p *peer.Peer) (*peer.Peer, *types.NetworkMapComponents, *types.NetworkMap, []*nmdata.PostureChecks, int64, error)

GetValidatedPeerWithComponents mocks base method.

func (*MockController) GetValidatedPeerWithMap

func (m *MockController) GetValidatedPeerWithMap(ctx context.Context, isRequiresApproval bool, accountID, peerID string) (*types.NetworkMap, []*nmdata.PostureChecks, int64, error)

GetValidatedPeerWithMap mocks base method.

func (*MockController) OnPeerConnected added in v0.60.5

func (m *MockController) OnPeerConnected(ctx context.Context, accountID, peerID string) (chan *UpdateMessage, error)

OnPeerConnected mocks base method.

func (*MockController) OnPeerDisconnected added in v0.60.5

func (m *MockController) OnPeerDisconnected(ctx context.Context, accountID, peerID string)

OnPeerDisconnected mocks base method.

func (*MockController) OnPeersAdded added in v0.60.5

func (m *MockController) OnPeersAdded(ctx context.Context, accountID string, peerIDs, affectedPeerIDs []string) error

OnPeersAdded mocks base method.

func (*MockController) OnPeersDeleted added in v0.60.5

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

OnPeersDeleted mocks base method.

func (*MockController) OnPeersUpdated added in v0.60.5

func (m *MockController) OnPeersUpdated(ctx context.Context, accountId string, peerIDs, affectedPeerIDs []string) error

OnPeersUpdated mocks base method.

func (*MockController) StartWarmup

func (m *MockController) StartWarmup(arg0 context.Context)

StartWarmup mocks base method.

func (*MockController) TrackEphemeralPeer added in v0.64.1

func (m *MockController) TrackEphemeralPeer(ctx context.Context, arg1 *peer.Peer)

TrackEphemeralPeer mocks base method.

func (*MockController) UpdateAccountPeer

func (m *MockController) UpdateAccountPeer(ctx context.Context, accountId, peerId string) error

UpdateAccountPeer mocks base method.

func (*MockController) UpdateAccountPeers

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

UpdateAccountPeers mocks base method.

func (*MockController) UpdateAffectedPeers added in v0.73.0

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

UpdateAffectedPeers mocks base method.

type MockControllerMockRecorder

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

MockControllerMockRecorder is the mock recorder for MockController.

func (*MockControllerMockRecorder) BufferUpdateAccountPeers

func (mr *MockControllerMockRecorder) BufferUpdateAccountPeers(ctx, accountID, reason any) *gomock.Call

BufferUpdateAccountPeers indicates an expected call of BufferUpdateAccountPeers.

func (*MockControllerMockRecorder) BufferUpdateAffectedPeers added in v0.73.0

func (mr *MockControllerMockRecorder) BufferUpdateAffectedPeers(ctx, accountID, peerIDs, reason any) *gomock.Call

BufferUpdateAffectedPeers indicates an expected call of BufferUpdateAffectedPeers.

func (*MockControllerMockRecorder) CountStreams added in v0.60.5

func (mr *MockControllerMockRecorder) CountStreams() *gomock.Call

CountStreams indicates an expected call of CountStreams.

func (*MockControllerMockRecorder) DisconnectPeers

func (mr *MockControllerMockRecorder) DisconnectPeers(ctx, accountId, peerIDs any) *gomock.Call

DisconnectPeers indicates an expected call of DisconnectPeers.

func (*MockControllerMockRecorder) GetDNSDomain

func (mr *MockControllerMockRecorder) GetDNSDomain(settings any) *gomock.Call

GetDNSDomain indicates an expected call of GetDNSDomain.

func (*MockControllerMockRecorder) GetNetworkMap

func (mr *MockControllerMockRecorder) GetNetworkMap(ctx, peerID any) *gomock.Call

GetNetworkMap indicates an expected call of GetNetworkMap.

func (*MockControllerMockRecorder) GetValidatedPeerWithComponents added in v0.75.0

func (mr *MockControllerMockRecorder) GetValidatedPeerWithComponents(ctx, isRequiresApproval, accountID, p any) *gomock.Call

GetValidatedPeerWithComponents indicates an expected call of GetValidatedPeerWithComponents.

func (*MockControllerMockRecorder) GetValidatedPeerWithMap

func (mr *MockControllerMockRecorder) GetValidatedPeerWithMap(ctx, isRequiresApproval, accountID, peerID any) *gomock.Call

GetValidatedPeerWithMap indicates an expected call of GetValidatedPeerWithMap.

func (*MockControllerMockRecorder) OnPeerConnected added in v0.60.5

func (mr *MockControllerMockRecorder) OnPeerConnected(ctx, accountID, peerID any) *gomock.Call

OnPeerConnected indicates an expected call of OnPeerConnected.

func (*MockControllerMockRecorder) OnPeerDisconnected added in v0.60.5

func (mr *MockControllerMockRecorder) OnPeerDisconnected(ctx, accountID, peerID any) *gomock.Call

OnPeerDisconnected indicates an expected call of OnPeerDisconnected.

func (*MockControllerMockRecorder) OnPeersAdded added in v0.60.5

func (mr *MockControllerMockRecorder) OnPeersAdded(ctx, accountID, peerIDs, affectedPeerIDs any) *gomock.Call

OnPeersAdded indicates an expected call of OnPeersAdded.

func (*MockControllerMockRecorder) OnPeersDeleted added in v0.60.5

func (mr *MockControllerMockRecorder) OnPeersDeleted(ctx, accountID, peerIDs, affectedPeerIDs any) *gomock.Call

OnPeersDeleted indicates an expected call of OnPeersDeleted.

func (*MockControllerMockRecorder) OnPeersUpdated added in v0.60.5

func (mr *MockControllerMockRecorder) OnPeersUpdated(ctx, accountId, peerIDs, affectedPeerIDs any) *gomock.Call

OnPeersUpdated indicates an expected call of OnPeersUpdated.

func (*MockControllerMockRecorder) StartWarmup

func (mr *MockControllerMockRecorder) StartWarmup(arg0 any) *gomock.Call

StartWarmup indicates an expected call of StartWarmup.

func (*MockControllerMockRecorder) TrackEphemeralPeer added in v0.64.1

func (mr *MockControllerMockRecorder) TrackEphemeralPeer(ctx, arg1 any) *gomock.Call

TrackEphemeralPeer indicates an expected call of TrackEphemeralPeer.

func (*MockControllerMockRecorder) UpdateAccountPeer

func (mr *MockControllerMockRecorder) UpdateAccountPeer(ctx, accountId, peerId any) *gomock.Call

UpdateAccountPeer indicates an expected call of UpdateAccountPeer.

func (*MockControllerMockRecorder) UpdateAccountPeers

func (mr *MockControllerMockRecorder) UpdateAccountPeers(ctx, accountID, reason any) *gomock.Call

UpdateAccountPeers indicates an expected call of UpdateAccountPeers.

func (*MockControllerMockRecorder) UpdateAffectedPeers added in v0.73.0

func (mr *MockControllerMockRecorder) UpdateAffectedPeers(ctx, accountID, peerIDs any) *gomock.Call

UpdateAffectedPeers indicates an expected call of UpdateAffectedPeers.

type PeersUpdateManager

type PeersUpdateManager interface {
	SendUpdate(ctx context.Context, peerID string, update *UpdateMessage)
	CreateChannel(ctx context.Context, peerID string) chan *UpdateMessage
	CloseChannel(ctx context.Context, peerID string)
	CountStreams() int
	HasChannel(peerID string) bool
	CloseChannels(ctx context.Context, peerIDs []string)
	GetAllConnectedPeers() map[string]struct{}
}

type UpdateMessage

type UpdateMessage struct {
	Update      *proto.SyncResponse
	MessageType MessageType
}

Directories

Path Synopsis
Package controller is a generated GoMock package.
Package controller is a generated GoMock package.
Package nmaptest measures network map generation on the dedicated store path against committed expectations.
Package nmaptest measures network map generation on the dedicated store path against committed expectations.

Jump to

Keyboard shortcuts

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