mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* Remove MDS and replace it with Controller This commit removes the MDS layer (and package) and shifts Controller package into its place. * add pprof/fgprof to serverless http router --------- Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
36 lines
1,009 B
Go
36 lines
1,009 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/featurebasedb/featurebase/v3/dax"
|
|
)
|
|
|
|
// NodeService represents a service for managing Nodes.
|
|
type NodeService interface {
|
|
CreateNode(dax.Transaction, dax.Address, *dax.Node) error
|
|
ReadNode(dax.Transaction, dax.Address) (*dax.Node, error)
|
|
DeleteNode(dax.Transaction, dax.Address) error
|
|
Nodes(dax.Transaction) ([]*dax.Node, error)
|
|
}
|
|
|
|
// Ensure type implements interface.
|
|
var _ NodeService = &nopNodeService{}
|
|
|
|
// nopNoder is a no-op implementation of the Noder interface.
|
|
type nopNodeService struct{}
|
|
|
|
func NewNopNodeService() *nopNodeService {
|
|
return &nopNodeService{}
|
|
}
|
|
|
|
func (n *nopNodeService) CreateNode(dax.Transaction, dax.Address, *dax.Node) error {
|
|
return nil
|
|
}
|
|
func (n *nopNodeService) ReadNode(dax.Transaction, dax.Address) (*dax.Node, error) {
|
|
return nil, nil
|
|
}
|
|
func (n *nopNodeService) DeleteNode(dax.Transaction, dax.Address) error {
|
|
return nil
|
|
}
|
|
func (n *nopNodeService) Nodes(dax.Transaction) ([]*dax.Node, error) {
|
|
return []*dax.Node{}, nil
|
|
}
|