func showPartitionConfig(w rest.ResponseWriter, r *rest.Request) {
	res := NewHypermediaResource()
	res.Links["self"] = HypermediaLink{
		Href: "/partition/{server}/{partition}/config",
	}
	partitionName := r.PathParam("partition")
	serverName := r.PathParam("server")
	db, partition, err := GetPartition(serverName, partitionName)
	if err == nil {
		res.Data["config"] = db.PartitionInfo(partition)
		res.Data["maintenanceJobId"] = partition.MaintenanceJobId
		for _, item := range c.Entries() {
			if item.Id == partition.MaintenanceJobId {
				res.Data["nextScheduledMaintenance"] = item.Next
			}
		}
		res.Success()
		w.WriteJson(res.End("The partition was found."))
	} else {
		l.Error(err)
		w.WriteJson(res.End("The partition was not found."))
	}
}
API: Shows just the configuration for a specific partition
package main
import (
	"github.com/ant0ine/go-json-rest/rest"
	"strconv"
	"time"
)
func showPartitions(w rest.ResponseWriter, r *rest.Request) {
	res := NewHypermediaResource()
	res.AddCurie("partitions", "/docs/rels/{rel}", true)
	res.Links["self"] = HypermediaLink{
		Href: "/partitions",
	}
	res.Links["partitions:add"] = HypermediaLink{
		Href: "/partitions/add",
	}
	res.Links["partitions:delete"] = HypermediaLink{
		Href:      "/partitions/delete/{server}/{partition}",
		Templated: true,
	}
	res.Links["partitions:read"] = HypermediaLink{
		Href:      "/partitions/read/{server}/{partition}",
		Templated: true,
	}
	type partitionInfo struct {
		Name      string    `json:"name"`
		Partition Partition `json:"partition"`
		Host      string    `json:"host"`
		Database  string    `json:"database"`
		Port      string    `json:"port"`
	}
	partitions := []partitionInfo{}
	for _, s := range cfg.Servers {
		for k, v := range s.Partitions {
			partitions = append(partitions, partitionInfo{
				Name:      k,
				Partition: v,
				Host:      s.Host,
				Database:  s.Database,
				Port:      s.Port,
			})
		}
	}
	res.Data["totalPartitions"] = len(partitions)
	res.Data["partitions"] = partitions
	res.Success()
	w.WriteJson(res.End("There are " + strconv.Itoa(len(partitions)) + " partitions managed."))
}
func showSchedule(w rest.ResponseWriter, r *rest.Request) {
	res := NewHypermediaResource()
	res.AddCurie("schedule", "/docs/rels/{rel}", true)
	res.Links["self"] = HypermediaLink{
		Href: "/schedule",
	}
	res.Links["schedule:add"] = HypermediaLink{
		Href: "/schedule/add",
	}
	res.Links["schedule:delete"] = HypermediaLink{
		Href:      "/schedule/delete/{id}",
		Templated: true,
	}
	jobs := []map[string]interface{}{}
	for _, item := range c.Entries() {
		m := make(map[string]interface{})
		m["id"] = item.Id
		m["name"] = item.Name
		m["next"] = item.Next
		m["prev"] = item.Prev
		m["job"] = getFunctionName(item.Job)
		jobs = append(jobs, m)
	}
	res.Data["totalJobs"] = len(jobs)
	res.Data["jobs"] = jobs
	res.Success()
	w.WriteJson(res.End("There are " + strconv.Itoa(len(jobs)) + " jobs scheduled."))
}
func showPartition(w rest.ResponseWriter, r *rest.Request) {
	res := NewHypermediaResource()
	res.Links["self"] = HypermediaLink{
		Href: "/partition/{server}/{partition}",
	}
	partitionName := r.PathParam("partition")
	serverName := r.PathParam("server")
	db, partition, err := GetPartition(serverName, partitionName)
	if err == nil {
		children := db.GetChildPartitions(partition)
		res.Data["totalChildren"] = len(children)
		res.Data["children"] = children
		res.Data["config"] = db.PartitionInfo(partition)
		res.Success()
		w.WriteJson(res.End("There are " + strconv.Itoa(len(children)) + " children for this partition."))
	} else {
		l.Error(err)
		w.WriteJson(res.End("The partition was not found."))
	}
}