feat: add service catalog management with policy integration for domain-based resource access control
Add ServiceCatalogItem type and services CRUD API endpoints (list, create, update, delete). Extend Policy type to include services array with domain, upstream_ip, proxy_ip, and ports metadata. Add ServicesPage component with table view and create/edit modals for managing service definitions. Include service name, domain, proxy, and upstream columns with port parsing logic. Integrate service selection
This commit is contained in:
35
backend/internal/servicecatalog/service.go
Normal file
35
backend/internal/servicecatalog/service.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package servicecatalog
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type CatalogService struct {
|
||||
repo Repository
|
||||
}
|
||||
|
||||
func NewService(repo Repository) *CatalogService {
|
||||
return &CatalogService{repo: repo}
|
||||
}
|
||||
|
||||
func (s *CatalogService) List(ctx context.Context) ([]Service, error) {
|
||||
return s.repo.List(ctx)
|
||||
}
|
||||
|
||||
func (s *CatalogService) Create(ctx context.Context, input CreateRequest) (Service, error) {
|
||||
return s.repo.Create(ctx, input)
|
||||
}
|
||||
|
||||
func (s *CatalogService) Update(ctx context.Context, serviceID uuid.UUID, input UpdateRequest) (Service, error) {
|
||||
return s.repo.Update(ctx, serviceID, input)
|
||||
}
|
||||
|
||||
func (s *CatalogService) Delete(ctx context.Context, serviceID uuid.UUID) error {
|
||||
return s.repo.Delete(ctx, serviceID)
|
||||
}
|
||||
|
||||
func (s *CatalogService) ByIDs(ctx context.Context, ids []uuid.UUID) ([]Service, error) {
|
||||
return s.repo.ByIDs(ctx, ids)
|
||||
}
|
||||
Reference in New Issue
Block a user