forked from jpoehls/go-conduit
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpaste.go
More file actions
32 lines (25 loc) · 692 Bytes
/
paste.go
File metadata and controls
32 lines (25 loc) · 692 Bytes
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
package gonduit
import (
"github.com/etcinit/gonduit/requests"
"github.com/etcinit/gonduit/responses"
)
// PasteCreate calls the paste.create endpoint.
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.
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
}