manager

package
v0.67.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EnvAutoAssignPortMin overrides the lower bound for auto-assigned L4 listen ports.
	EnvAutoAssignPortMin = "NB_PROXY_PORT_MIN"
	// EnvAutoAssignPortMax overrides the upper bound for auto-assigned L4 listen ports.
	EnvAutoAssignPortMax = "NB_PROXY_PORT_MAX"
)

Variables

This section is empty.

Functions

func RegisterEndpoints

func RegisterEndpoints(manager rpservice.Manager, domainManager domainmanager.Manager, accessLogsManager accesslogs.Manager, permissionsManager permissions.Manager, router *mux.Router)

RegisterEndpoints registers all service HTTP endpoints.

Types

type CapabilityProvider added in v0.67.2

type CapabilityProvider interface {
	ClusterSupportsCustomPorts(ctx context.Context, clusterAddr string) *bool
	ClusterRequireSubdomain(ctx context.Context, clusterAddr string) *bool
}

CapabilityProvider queries proxy cluster capabilities from the database.

type ClusterDeriver

type ClusterDeriver interface {
	DeriveClusterFromDomain(ctx context.Context, accountID, domain string) (string, error)
	GetClusterDomains() []string
}

ClusterDeriver derives the proxy cluster from a domain.

type Manager

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

func NewManager

func NewManager(store store.Store, accountManager account.Manager, permissionsManager permissions.Manager, proxyController proxy.Controller, capabilities CapabilityProvider, clusterDeriver ClusterDeriver) *Manager

NewManager creates a new service manager.

func (*Manager) CreateService

func (m *Manager) CreateService(ctx context.Context, accountID, userID string, s *service.Service) (*service.Service, error)

func (*Manager) CreateServiceFromPeer

func (m *Manager) CreateServiceFromPeer(ctx context.Context, accountID, peerID string, req *service.ExposeServiceRequest) (*service.ExposeServiceResponse, error)

CreateServiceFromPeer creates a service initiated by a peer expose request. It validates the request, checks expose permissions, enforces the per-peer limit, creates the service, and tracks it for TTL-based reaping.

func (*Manager) DeleteAllServices

func (m *Manager) DeleteAllServices(ctx context.Context, accountID, userID string) error

func (*Manager) DeleteService

func (m *Manager) DeleteService(ctx context.Context, accountID, userID, serviceID string) error

func (*Manager) GetAccountServices

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

func (*Manager) GetActiveClusters added in v0.67.0

func (m *Manager) GetActiveClusters(ctx context.Context, accountID, userID string) ([]proxy.Cluster, error)

GetActiveClusters returns all active proxy clusters with their connected proxy count.

func (*Manager) GetAllServices

func (m *Manager) GetAllServices(ctx context.Context, accountID, userID string) ([]*service.Service, error)

func (*Manager) GetGlobalServices

func (m *Manager) GetGlobalServices(ctx context.Context) ([]*service.Service, error)

func (*Manager) GetService

func (m *Manager) GetService(ctx context.Context, accountID, userID, serviceID string) (*service.Service, error)

func (*Manager) GetServiceByID

func (m *Manager) GetServiceByID(ctx context.Context, accountID, serviceID string) (*service.Service, error)

func (*Manager) GetServiceIDByTargetID

func (m *Manager) GetServiceIDByTargetID(ctx context.Context, accountID string, resourceID string) (string, error)

func (*Manager) ReloadAllServicesForAccount

func (m *Manager) ReloadAllServicesForAccount(ctx context.Context, accountID string) error

func (*Manager) ReloadService

func (m *Manager) ReloadService(ctx context.Context, accountID, serviceID string) error

func (*Manager) RenewServiceFromPeer

func (m *Manager) RenewServiceFromPeer(ctx context.Context, accountID, peerID, serviceID string) error

RenewServiceFromPeer updates the DB timestamp for the peer's ephemeral service.

func (*Manager) SetCertificateIssuedAt

func (m *Manager) SetCertificateIssuedAt(ctx context.Context, accountID, serviceID string) error

SetCertificateIssuedAt sets the certificate issued timestamp to the current time. Call this when receiving a gRPC notification that the certificate was issued.

func (*Manager) SetStatus

func (m *Manager) SetStatus(ctx context.Context, accountID, serviceID string, status service.Status) error

SetStatus updates the status of the service (e.g., "active", "tunnel_not_created", etc.)

func (*Manager) StartExposeReaper

func (m *Manager) StartExposeReaper(ctx context.Context)

StartExposeReaper starts the background goroutine that reaps expired ephemeral services.

func (*Manager) StopServiceFromPeer

func (m *Manager) StopServiceFromPeer(ctx context.Context, accountID, peerID, serviceID string) error

StopServiceFromPeer stops a peer's active expose session by deleting the service from the DB.

func (*Manager) UpdateService

func (m *Manager) UpdateService(ctx context.Context, accountID, userID string, service *service.Service) (*service.Service, error)

Jump to

Keyboard shortcuts

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