lxd/db/raft.go
func (n *NodeTx) RaftNodes() ([]RaftNode, error) {
	nodes := []RaftNode{}
	dest := func(i int) []interface{} {
		nodes = append(nodes, RaftNode{})
		return []interface{}{&nodes[i].ID, &nodes[i].Address}
	}
	stmt, err := n.tx.Prepare("SELECT id, address FROM raft_nodes ORDER BY id")
	if err != nil {
		return nil, err
	}
	defer stmt.Close()
	err = query.SelectObjects(stmt, dest)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to fetch raft nodes")
	}
	return nodes, nil
}
func (n *NodeTx) RaftNodes() ([]RaftNode, error) {
	nodes := []RaftNode{}
	dest := func(i int) []interface{} {
		nodes = append(nodes, RaftNode{})
		return []interface{}{&nodes[i].ID, &nodes[i].Address}
	}
	stmt, err := n.tx.Prepare("SELECT id, address FROM raft_nodes ORDER BY id")
	if err != nil {
		return nil, err
	}
	defer stmt.Close()
	err = query.SelectObjects(stmt, dest)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to fetch raft nodes")
	}
	return nodes, nil
}
// RaftNodes returns information about all LXD nodes that are members of the
// dqlite Raft cluster (possibly including the local node). If this LXD
// instance is not running in clustered mode, an empty list is returned.