func (c *Core) Cluster() (*Cluster, error) {
	var cluster Cluster
	entry, err := c.barrier.Get(coreLocalClusterInfoPath)
	if err != nil {
		return nil, err
	}
	if entry == nil {
		return &cluster, nil
	}
	if err = jsonutil.DecodeJSON(entry.Value, &cluster); err != nil {
		return nil, fmt.Errorf("failed to decode cluster details: %v", err)
	}
	if c.clusterName != "" {
		cluster.Name = c.clusterName
	}
	return &cluster, nil
}
Cluster fetches the details of either local or global cluster based on the
input. This method errors out when Vault is sealed.
package vault
import (
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/rand"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/json"
	"errors"
	"fmt"
	"math/big"
	mathrand "math/rand"
	"net"
	"net/http"
	"time"
	log "github.com/mgutz/logxi/v1"
	"golang.org/x/net/http2"
	"github.com/hashicorp/go-uuid"
	"github.com/hashicorp/vault/helper/forwarding"
	"github.com/hashicorp/vault/helper/jsonutil"
)
const (
	coreLocalClusterInfoPath = "core/cluster/local/info"
	corePrivateKeyTypeP521 = "p521"
	IntNoForwardingHeaderName = "X-Vault-Internal-No-Request-Forwarding"
)
var (
	ErrCannotForward = errors.New("cannot forward request; no connection or address not known")
)
type clusterKeyParams struct {
	Type string   `json:"type"`
	X    *big.Int `json:"x"`
	Y    *big.Int `json:"y"`
	D    *big.Int `json:"d"`
}
type activeConnection struct {
	transport   *http2.Transport
	clusterAddr string
}
type Cluster struct {
	Name string `json:"name" structs:"name" mapstructure:"name"`
	ID string `json:"id" structs:"id" mapstructure:"id"`
}