Vendor main dependencies.
This commit is contained in:
parent
49a09ab7dd
commit
dd5e3fba01
2738 changed files with 1045689 additions and 0 deletions
25
vendor/github.com/JamesClonk/vultr/lib/os.go
generated
vendored
Normal file
25
vendor/github.com/JamesClonk/vultr/lib/os.go
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
package lib
|
||||
|
||||
// OS image on Vultr
|
||||
type OS struct {
|
||||
ID int `json:"OSID"`
|
||||
Name string `json:"name"`
|
||||
Arch string `json:"arch"`
|
||||
Family string `json:"family"`
|
||||
Windows bool `json:"windows"`
|
||||
Surcharge string `json:"surcharge"`
|
||||
}
|
||||
|
||||
// GetOS returns a list of all available operating systems on Vultr
|
||||
func (c *Client) GetOS() ([]OS, error) {
|
||||
var osMap map[string]OS
|
||||
if err := c.get(`os/list`, &osMap); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var osList []OS
|
||||
for _, os := range osMap {
|
||||
osList = append(osList, os)
|
||||
}
|
||||
return osList, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue