2016-06-07 14:28:28 -07:00
|
|
|
package controlapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
2016-07-20 17:34:33 -07:00
|
|
|
"github.com/docker/swarmkit/ca"
|
2016-06-07 14:28:28 -07:00
|
|
|
"github.com/docker/swarmkit/manager/state/raft"
|
|
|
|
"github.com/docker/swarmkit/manager/state/store"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
errNotImplemented = errors.New("not implemented")
|
|
|
|
errInvalidArgument = errors.New("invalid argument")
|
|
|
|
)
|
|
|
|
|
|
|
|
// Server is the Cluster API gRPC server.
|
|
|
|
type Server struct {
|
2016-07-20 17:34:33 -07:00
|
|
|
store *store.MemoryStore
|
|
|
|
raft *raft.Node
|
|
|
|
rootCA *ca.RootCA
|
2016-06-07 14:28:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewServer creates a Cluster API server.
|
2016-07-20 17:34:33 -07:00
|
|
|
func NewServer(store *store.MemoryStore, raft *raft.Node, rootCA *ca.RootCA) *Server {
|
2016-06-07 14:28:28 -07:00
|
|
|
return &Server{
|
2016-07-20 17:34:33 -07:00
|
|
|
store: store,
|
|
|
|
raft: raft,
|
|
|
|
rootCA: rootCA,
|
2016-06-07 14:28:28 -07:00
|
|
|
}
|
|
|
|
}
|