func (a *API) Get(ctx context.Context, req *http.Request) api.Response {
	defer req.Body.Close()
	d, err := api.GetDaemon(ctx)
	if err != nil {
		return api.InternalError(err)
	}
	var name string
	if err := d.Cluster().Transaction(func(tx *db.ClusterTx) error {
		var err error
		name, err = tx.NodeName()
		return errors.WithStack(err)
	}); err != nil {
		return api.SmartError(err)
	}
	if name == "none" {
		name = ""
	}
	cluster := Cluster{
		ServerName: name,
		Enabled:    name != "",
	}
	return api.SyncResponseETag(true, cluster, cluster)
}
Get defines a service for calling "GET" method and returns a response.
Return information about the cluster.
package cluster
import (
	"context"
	"encoding/json"
	"net/http"
	"github.com/go-kit/kit/log"
	"github.com/spoke-d/thermionic/internal/clock"
	"github.com/spoke-d/thermionic/internal/fsys"
	"github.com/pkg/errors"
	"github.com/spoke-d/thermionic/internal/db"
	"github.com/spoke-d/thermionic/pkg/api"
)
type API struct {
	api.DefaultService
	name string
	logger     log.Logger
	fileSystem fsys.FileSystem
	clock      clock.Clock
}
func NewAPI(name string, options ...Option) *API {
	opts := newOptions()
	for _, option := range options {
		option(opts)
	}
	return &API{
		name:       name,
		logger:     opts.logger,
		fileSystem: opts.fileSystem,
		clock:      opts.clock,
	}
}
func (a *API) Name() string {
	return a.name
}