You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: config.go
    path of file: ./repos/evcc/vehicle
    
    the code of the file until where you have to start completion: package vehicle

import (
	"fmt"
	"strings"
	"time"

	"github.com/evcc-io/evcc/api"
	"github.com/evcc-io/evcc/util"
)

const (
	expiry   = 5 * time.Minute  // maximum response age before refresh
	interval = 15 * time.Minute // refresh interval when charging
)

type vehicleRegistry map[strin
    
func NewFromConfig(typ string, other map[string]interface{}) (api.Vehicle, error) {
	var cc struct {
		Cloud bool
		Other map[string]interface{} `mapstructure:",remain"`
	}

	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}

	if cc.Cloud {
		cc.Other["brand"] = typ
		typ = "cloud"
	}

	factory, err := registry.Get(strings.ToLower(typ))
	if err != nil {
		return nil, err
	}

	v, err := factory(cc.Other)
	if err != nil {
		err = fmt.Errorf("cannot create vehicle type '%s': %w", typ, err)
	}

	return v, err
}