Example #1
0
func VultrFromJSON(jsonData []byte) (compute.Provider, error) {
	var cfg VultrJSONConfig
	err := json.Unmarshal(jsonData, &cfg)
	if err != nil {
		return nil, err
	}
	return &Vultr{
		client: vultr.NewClient(cfg.ApiKey, nil),
	}, nil
}
Example #2
0
func MakeVultr(apiKey string, regionId int) *Vultr {
	this := new(Vultr)
	this.regionId = regionId
	this.client = vultr.NewClient(apiKey, nil)
	return this
}