Vendor main dependencies.
This commit is contained in:
parent
49a09ab7dd
commit
dd5e3fba01
2738 changed files with 1045689 additions and 0 deletions
27
vendor/github.com/JamesClonk/vultr/lib/regions.go
generated
vendored
Normal file
27
vendor/github.com/JamesClonk/vultr/lib/regions.go
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
package lib
|
||||
|
||||
// Region on Vultr
|
||||
type Region struct {
|
||||
ID int `json:"DCID,string"`
|
||||
Name string `json:"name"`
|
||||
Country string `json:"country"`
|
||||
Continent string `json:"continent"`
|
||||
State string `json:"state"`
|
||||
Ddos bool `json:"ddos_protection"`
|
||||
BlockStorage bool `json:"block_storage"`
|
||||
Code string `json:"regioncode"`
|
||||
}
|
||||
|
||||
// GetRegions returns a list of all available Vultr regions
|
||||
func (c *Client) GetRegions() ([]Region, error) {
|
||||
var regionMap map[string]Region
|
||||
if err := c.get(`regions/list`, ®ionMap); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var regionList []Region
|
||||
for _, os := range regionMap {
|
||||
regionList = append(regionList, os)
|
||||
}
|
||||
return regionList, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue