func (c *Cluster) Enabled() (bool, string, error) {
	var enabled bool
	var etag string
	if err := c.client.exec("GET", "/1.0/cluster", nil, "", func(response *client.Response, meta Metadata) error {
		var clusterInfo cluster.Cluster
		if err := json.Read(bytes.NewReader(response.Metadata), &clusterInfo); err != nil {
			return errors.Wrap(err, "error parsing result")
		}
		enabled = clusterInfo.Enabled
		etag = meta.ETag
		return nil
	}); err != nil {
		return false, "", errors.WithStack(err)
	}
	return enabled, etag, nil
}
Enabled returns if the cluster is enabled or not
package client
import (
	"bytes"
	libjson "encoding/json"
	"fmt"
	"sync"
	"github.com/pkg/errors"
	"github.com/spoke-d/thermionic/internal/json"
	"github.com/spoke-d/thermionic/pkg/api/daemon/cluster"
	"github.com/spoke-d/thermionic/pkg/api/daemon/operations"
	"github.com/spoke-d/thermionic/pkg/client"
	"github.com/spoke-d/thermionic/pkg/events"
)
type ClusterCertInfo struct {
	Certificate string
	Key         string
}
type Cluster struct {
	client *Client
}
func (c *Cluster) Join(name, address, etag string, certInfo ClusterCertInfo) error {
	info := cluster.ClusterJoin{
		Cluster: cluster.Cluster{
			ServerName: name,
			Enabled:    true,
		},
		ClusterAddress:     address,
		ClusterCertificate: certInfo.Certificate,
		ClusterKey:         certInfo.Key,
	}
	eventsTask := events.NewEvents(c.client.RawClient())
	listener, err := eventsTask.GetEvents()
	if err != nil {
		listener = nil
	}
	var op operations.Op
	if err := c.client.exec("PUT", "/1.0/cluster", info, etag, func(response *client.Response, meta Metadata) error {
		if err := json.Read(bytes.NewReader(response.Metadata), &op); err != nil {
			if listener != nil {
				listener.Disconnect()
			}
			return errors.Wrap(err, "error parsing operation")
		}
		return nil
	}); err != nil {
		return errors.WithStack(err)
	}
	localOp := &operation{
		op:         op,
		client:     c.client,
		listener:   listener,
		activeChan: make(chan bool),
	}
	return localOp.Wait()
}
func (c *Cluster) Remove(name string, force bool) error {
	var forceQuery string
	if force {
		forceQuery = "?force=1"
	}
	err := c.client.exec("DELETE", fmt.Sprintf("/1.0/cluster/members/%s%s", name, forceQuery), nil, "", nopReadFn)
	return errors.WithStack(err)
}