func Deregister(key string) error {
	err := db.DeleteAddon(key)
	if err != nil {
		return err
	}
	delete(Types, key)
	return nil
}
Deregister removes an addon from the system. `key` is the addon_reverse_dns
package addon
import (
	"encoding/json"
	"fmt"
	"net/url"
	"strings"
	"github.com/ponzu-cms/ponzu/system/db"
	"github.com/ponzu-cms/ponzu/system/item"
	"github.com/tidwall/sjson"
)
var (
	Types = make(map[string]func() interface{})
)
const (
	StatusEnabled = "enabled"
	StatusDisabled = "disabled"
)
type Meta struct {
	PonzuAddonName       string `json:"addon_name"`
	PonzuAddonAuthor     string `json:"addon_author"`
	PonzuAddonAuthorURL  string `json:"addon_author_url"`
	PonzuAddonVersion    string `json:"addon_version"`
	PonzuAddonReverseDNS string `json:"addon_reverse_dns"`
	PonzuAddonStatus     string `json:"addon_status"`
}
type Addon struct {
	item.Item
	Meta
}
func Register(m Meta, fn func() interface{}) Addon {
	if m.PonzuAddonReverseDNS == "" {
		revDNS, err := reverseDNS(m)
		if err != nil {
			panic(err)
		}
		m.PonzuAddonReverseDNS = revDNS
	}
	Types[m.PonzuAddonReverseDNS] = fn
	a := Addon{Meta: m}
	err := register(a)
	if err != nil {
		panic(err)
	}
	return a
}
func register(a Addon) error {
	if a.PonzuAddonName == "" {
		return fmt.Errorf(`Addon must have valid Meta struct embedded: missing %s field.`, "PonzuAddonName")
	}
	if a.PonzuAddonAuthor == "" {
		return fmt.Errorf(`Addon must have valid Meta struct embedded: missing %s field.`, "PonzuAddonAuthor")
	}
	if a.PonzuAddonAuthorURL == "" {
		return fmt.Errorf(`Addon must have valid Meta struct embedded: missing %s field.`, "PonzuAddonAuthorURL")
	}
	if a.PonzuAddonVersion == "" {
		return fmt.Errorf(`Addon must have valid Meta struct embedded: missing %s field.`, "PonzuAddonVersion")
	}
	if _, ok := Types[a.PonzuAddonReverseDNS]; !ok {
		return fmt.Errorf(`Addon "%s" has no record in the addons.Types map`, a.PonzuAddonName)
	}
	if db.AddonExists(a.PonzuAddonReverseDNS) {
		return nil
	}
	kv := make(map[string]interface{})
	data, err := json.Marshal(a.Item)
	if err != nil {
		return err
	}
	err = json.Unmarshal(data, &kv)
	if err != nil {
		return err
	}
	vals := make(url.Values)
	for k, v := range kv {
		vals.Set(k, fmt.Sprintf("%v", v))
	}
	vals.Set("addon_name", a.PonzuAddonName)
	vals.Set("addon_author", a.PonzuAddonAuthor)
	vals.Set("addon_author_url", a.PonzuAddonAuthorURL)
	vals.Set("addon_version", a.PonzuAddonVersion)
	vals.Set("addon_reverse_dns", a.PonzuAddonReverseDNS)
	vals.Set("addon_status", StatusDisabled)
	kind, ok := Types[a.PonzuAddonReverseDNS]
	if !ok {
		return fmt.Errorf("Error: no addon to set with id: %s", a.PonzuAddonReverseDNS)
	}
	err = db.SetAddon(vals, kind())
	if err != nil {
		return err
	}
	return nil
}