refactor: clean up NodeService interface; move all integrity logic behind it

This commit is contained in:
2026-03-31 15:55:47 +02:00
parent ed9117951f
commit 8d831d131b
9 changed files with 484 additions and 388 deletions

View File

@@ -7,13 +7,10 @@ import (
"strings"
)
func parseRelFlag(svc service.NodeService, s string) (*models.Rel, error) {
// parseRelInput parses a "type:target" string into a RelInput.
func parseRelInput(s string) (service.RelInput, error) {
if p := strings.SplitN(s, ":", 2); len(p) == 2 {
return &models.Rel{Type: models.RelType(p[0]), Target: p[1]}, nil
return service.RelInput{Type: models.RelType(p[0]), Target: p[1]}, nil
}
// name resolution for rels
//TODO:
return &models.Rel{}, fmt.Errorf("invalid relation format: %s (expected type:id)", s)
return service.RelInput{}, fmt.Errorf("invalid relation format: %s (expected type:target)", s)
}