-
Notifications
You must be signed in to change notification settings - Fork 15
/
results.go
48 lines (39 loc) · 901 Bytes
/
results.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package vrrpaddresses
import (
"github.com/gophercloud/gophercloud"
)
type VRRPAddressResp struct {
VRRPAddress VRRPAddress `json:"dc_vrrp_address"`
}
type VRRPAddress struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
DCVRRPID string `json:"dc_vrrp_id"`
IPAddress string `json:"ip_address"`
PortID string `json:"port_id"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type commonResult struct {
gophercloud.Result
}
func (r commonResult) Extract() (*VRRPAddress, error) {
var res *VRRPAddressResp
if err := r.ExtractInto(&res); err != nil {
return nil, err
}
return &res.VRRPAddress, nil
}
type CreateResult struct {
commonResult
}
type GetResult struct {
commonResult
}
type UpdateResult struct {
commonResult
}
type DeleteResult struct {
gophercloud.ErrResult
}