Fix cluster api responses

This commit is contained in:
Ingo Oppermann
2022-09-28 21:49:25 +02:00
parent 692b65b97c
commit 9ef4ae9b5e
6 changed files with 89 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ package cluster
import (
"context"
"errors"
"fmt"
"io"
"sync"
@@ -11,6 +12,8 @@ import (
"github.com/datarhei/core/v16/net"
)
var ErrNodeNotFound = errors.New("node not found")
type ClusterReader interface {
GetURL(path string) (string, error)
GetFile(path string) (io.ReadCloser, error)
@@ -182,7 +185,7 @@ func (c *cluster) RemoveNode(id string) error {
node, ok := c.nodes[id]
if !ok {
return nil
return ErrNodeNotFound
}
node.stop()