Documentation
¶
Index ¶
- Constants
- func RegisterEndpoints(manager rpservice.Manager, domainManager domainmanager.Manager, ...)
- type CapabilityProvider
- type ClusterDeriver
- type Manager
- func (m *Manager) CreateService(ctx context.Context, accountID, userID string, s *service.Service) (*service.Service, error)
- func (m *Manager) CreateServiceFromPeer(ctx context.Context, accountID, peerID string, ...) (*service.ExposeServiceResponse, error)
- func (m *Manager) DeleteAllServices(ctx context.Context, accountID, userID string) error
- func (m *Manager) DeleteService(ctx context.Context, accountID, userID, serviceID string) error
- func (m *Manager) GetAccountServices(ctx context.Context, accountID string) ([]*service.Service, error)
- func (m *Manager) GetActiveClusters(ctx context.Context, accountID, userID string) ([]proxy.Cluster, error)
- func (m *Manager) GetAllServices(ctx context.Context, accountID, userID string) ([]*service.Service, error)
- func (m *Manager) GetGlobalServices(ctx context.Context) ([]*service.Service, error)
- func (m *Manager) GetService(ctx context.Context, accountID, userID, serviceID string) (*service.Service, error)
- func (m *Manager) GetServiceByID(ctx context.Context, accountID, serviceID string) (*service.Service, error)
- func (m *Manager) GetServiceIDByTargetID(ctx context.Context, accountID string, resourceID string) (string, error)
- func (m *Manager) ReloadAllServicesForAccount(ctx context.Context, accountID string) error
- func (m *Manager) ReloadService(ctx context.Context, accountID, serviceID string) error
- func (m *Manager) RenewServiceFromPeer(ctx context.Context, accountID, peerID, serviceID string) error
- func (m *Manager) SetCertificateIssuedAt(ctx context.Context, accountID, serviceID string) error
- func (m *Manager) SetStatus(ctx context.Context, accountID, serviceID string, status service.Status) error
- func (m *Manager) StartExposeReaper(ctx context.Context)
- func (m *Manager) StopServiceFromPeer(ctx context.Context, accountID, peerID, serviceID string) error
- func (m *Manager) UpdateService(ctx context.Context, accountID, userID string, service *service.Service) (*service.Service, error)
Constants ¶
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 (*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 (*Manager) DeleteService ¶
func (*Manager) GetAccountServices ¶
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 (*Manager) GetGlobalServices ¶
func (*Manager) GetService ¶
func (*Manager) GetServiceByID ¶
func (*Manager) GetServiceIDByTargetID ¶
func (*Manager) ReloadAllServicesForAccount ¶
func (*Manager) ReloadService ¶
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 ¶
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 ¶
StartExposeReaper starts the background goroutine that reaps expired ephemeral services.