func parseType(data json.RawMessage) (string, error) {
	if len(data) == 0 {
		return "", nil
	}
	var t struct{ Type string }
	err := json.Unmarshal(data, &t)
	if err != nil {
		return "", err
	}
	return t.Type, nil
}
Find the type, which is simply the string value for the key "Type"
package jsonconfig
import (
	"encoding/json"
	"fmt"
	"path"
	"regexp"
	"strings"
	"github.com/davecgh/go-spew/spew"
	log "github.com/sirupsen/logrus"
	"github.com/twitter/scoot/ice"
)
type Schema map[string]Implementations
func EmptySchema() Schema {
	return map[string]Implementations{}
}
type Implementations map[string]Implementation
type Implementation interface {
	ice.Module
}
type Configuration map[string]ice.Module
func (c Configuration) Install(bag *ice.MagicBag) {
	for _, v := range c {
		bag.InstallModule(v)
	}
}
var emptyJson = []byte("{}")
func (schema Schema) Parse(text []byte) (Configuration, error) {
	var parsedConfig map[string]json.RawMessage
	if len(text) == 0 {
		text = emptyJson
	}
	err := json.Unmarshal(text, &parsedConfig)
	if err != nil {
		return nil, fmt.Errorf("Couldn't parse top-level config: %v", err)
	}
	log.Infof("config parsed to:%s", spew.Sdump(parsedConfig))
	result := Configuration(make(map[string]ice.Module))
	for optionName, impls := range schema {
		optionText := parsedConfig[optionName]
		implName, err := parseType(optionText)
		if err != nil {
			return nil, fmt.Errorf("Error parsing type for Implementations %v: %v", optionName, err)
		}
		impl, ok := impls[implName]
		if !ok {
			return nil, fmt.Errorf("Error parsing Implementations %v: %q is not a valid Implementation %v %v %T", optionName, implName, impls, impl, impl)
		}
		if len(optionText) > 0 {
			err = json.Unmarshal(optionText, &impl)
			if err != nil {
				return nil, fmt.Errorf("Error parsing variable %v: %v", optionName, err)
			}
		}
		result[optionName] = impl
	}
	return result, nil
}