~thrrgilag/woodstock

woodstock/stream_marker.go -rw-r--r-- 563 bytes
62b10b5cMorgan McMillian Update for new project location and module name 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package woodstock

// MarkersResult response object
type MarkersResult struct {
	*CommonResponse
	Data []Marker `json:"data"`
}

// SetMarker sets the current read marker
// this func will be updated
// https://pnut.io/docs/resources/stream-marker
// https://pnut.io/docs/resources/stream-marker#post-markers
func (c *Client) SetMarker(json string) (result MarkersResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: MarkerAPI, data: &result, method: "POST", responseCh: responseCh, json: json}
	return result, (<-responseCh).err
}