Documentation
¶
Index ¶
- func RegisterEndpoints(manager rpservice.Manager, domainManager domainmanager.Manager, ...)
- 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) 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, domain 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, domain string) error
- func (m *Manager) UpdateService(ctx context.Context, accountID, userID string, service *service.Service) (*service.Service, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEndpoints ¶
func RegisterEndpoints(manager rpservice.Manager, domainManager domainmanager.Manager, accessLogsManager accesslogs.Manager, router *mux.Router)
RegisterEndpoints registers all service HTTP endpoints.
Types ¶
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, 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) GetAllServices ¶
func (*Manager) GetGlobalServices ¶
func (*Manager) GetService ¶
func (*Manager) GetServiceByID ¶
func (*Manager) GetServiceIDByTargetID ¶
func (*Manager) ReloadAllServicesForAccount ¶
func (*Manager) ReloadService ¶
func (*Manager) RenewServiceFromPeer ¶
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.
func (*Manager) StopServiceFromPeer ¶
StopServiceFromPeer stops a peer's active expose session by deleting the service from the DB.