(ctx context.Context, id string)
| 160 | } |
| 161 | |
| 162 | func (s *nodeService) GetNode(ctx context.Context, id string) (*Node, error) { |
| 163 | s.mu.RLock() |
| 164 | defer s.mu.RUnlock() |
| 165 | node, ok := s.nodes[id] |
| 166 | if !ok { |
| 167 | return nil, errors.NewNotFoundError("node not found") |
| 168 | } |
| 169 | return node, nil |
| 170 | } |
| 171 | |
| 172 | func (s *nodeService) CreateNode(ctx context.Context, node *Node) error { |
| 173 | s.mu.Lock() |