forked from etcinit/gonduit
-
Notifications
You must be signed in to change notification settings - Fork 11
/
paste.go
43 lines (35 loc) · 1.18 KB
/
paste.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
package gonduit
import (
"github.com/thought-machine/gonduit/requests"
"github.com/thought-machine/gonduit/responses"
)
// PasteCreate calls the paste.create endpoint.
// Deprecated: This method is frozen and will eventually be deprecated. New code should use "paste.edit" instead.
func (c *Conn) PasteCreate(
req *requests.PasteCreateRequest,
) (responses.PasteCreateResponse, error) {
var res responses.PasteCreateResponse
if err := c.Call("paste.create", &req, &res); err != nil {
return nil, err
}
return res, nil
}
// PasteQuery calls the paste.query endpoint.
// Deprecated: This method is frozen and will eventually be deprecated. New code should use "paste.search" instead.
func (c *Conn) PasteQuery(
req *requests.PasteQueryRequest,
) (responses.PasteQueryResponse, error) {
var res responses.PasteQueryResponse
if err := c.Call("paste.query", &req, &res); err != nil {
return nil, err
}
return res, nil
}
// PasteSearch performs a call to paste.search
func (c *Conn) PasteSearch(req requests.SearchRequest) (*responses.SearchResponse, error) {
var res responses.SearchResponse
if err := c.Call("paste.search", &req, &res); err != nil {
return nil, err
}
return &res, nil
}