forked from etcinit/gonduit
-
Notifications
You must be signed in to change notification settings - Fork 11
/
almanac.go
97 lines (85 loc) · 3.13 KB
/
almanac.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package gonduit
import (
"github.com/thought-machine/gonduit/requests"
"github.com/thought-machine/gonduit/responses"
)
// AlmanacNetworkSearch performs a call to almanac.network.search
func (c *Conn) AlmanacNetworkSearch (req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("almanac.network.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacNetworkEdit performs a call to almanac.network.edit
func (c *Conn) AlmanacNetworkEdit (req requests.EditRequest) (*responses.EditResponse, error) {
var res responses.EditResponse
if err := c.Call("almanac.network.edit", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacDeviceSearch performs a call to almanac.device.search
func (c *Conn) AlmanacDeviceSearch (req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("almanac.device.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacDeviceEdit performs a call to almanac.device.edit
func (c *Conn) AlmanacDeviceEdit (req requests.EditRequest) (*responses.EditResponse, error) {
var res responses.EditResponse
if err := c.Call("almanac.device.edit", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacServiceSearch performs a call to almanac.service.search
func (c *Conn) AlmanacServiceSearch (req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("almanac.service.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacServiceEdit performs a call to almanac.service.edit
func (c *Conn) AlmanacServiceEdit (req requests.EditRequest) (*responses.EditResponse, error) {
var res responses.EditResponse
if err := c.Call("almanac.service.edit", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacBindingSearch performs a call to almanac.binding.search
func (c *Conn) AlmanacBindingSearch (req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("almanac.binding.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacBindingEdit performs a call to almanac.binding.edit
func (c *Conn) AlmanacBindingEdit (req requests.EditRequest) (*responses.EditResponse, error) {
var res responses.EditResponse
if err := c.Call("almanac.binding.edit", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacInterfaceSearch performs a call to almanac.interface.search
func (c *Conn) AlmanacInterfaceSearch (req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("almanac.interface.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}
// AlmanacInterfaceEdit performs a call to almanac.interface.edit
func (c *Conn) AlmanacInterfaceEdit (req requests.EditRequest) (*responses.EditResponse, error) {
var res responses.EditResponse
if err := c.Call("almanac.interface.edit", &req, &res); err != nil {
return nil, err
}
return &res, nil
}