~thrrgilag/woodstock

4440946aa000b01e5ed90fb3b4e6724da5b73069 — Morgan McMillian 1 year, 5 months ago 7a38312
update pnut.io doc links
9 files changed, 82 insertions(+), 82 deletions(-)

M access_token.go
M api.go
M channels.go
M client_info.go
M files.go
M posts.go
M precense.go
M stream_marker.go
M users.go
M access_token.go => access_token.go +2 -2
@@ 5,14 5,14 @@ import (
	"strings"
)

// App or client object, https://pnut.io/docs/api/resources/clients
// App or client object, https://pnut.io/docs/resources/clients
type App struct {
	ID   string `json:"id"`
	Link string `json:"link"`
	Name string `json:"name"`
}

// Token object, https://pnut.io/docs/api/resources/token
// Token object, https://pnut.io/docs/resources/token
type Token struct {
	App      App      `json:"app"`
	Scopes   []string `json:"scopes"`

M api.go => api.go +1 -1
@@ 4,7 4,7 @@ import (
	"net/http"
)

// pnut.io v0 API endpoints, see https://pnut.io/docs/api/implementation/overview
// pnut.io v0 API endpoints, see https://pnut.io/docs/implementation/overview
const (
	AuthenticateURL       = "https://pnut.io/oauth/authenticate"
	APIBasesURL           = "https://api.pnut.io/v0/"

M channels.go => channels.go +19 -19
@@ 28,7 28,7 @@ type createMessage struct {
}

// GetChannel retrieves the channel object from the channel ID
// https://pnut.io/docs/api/resources/channels/lookup#get-channels-id
// https://pnut.io/docs/resources/channels/lookup#get-channels-id
func (c *Client) GetChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}


@@ 36,7 36,7 @@ func (c *Client) GetChannel(id string) (result ChannelResult, err error) {
}

// GetChannels retrieves a list of channels from the provided channel IDs
// https://pnut.io/docs/api/resources/channels/lookup#get-channels
// https://pnut.io/docs/resources/channels/lookup#get-channels
func (c *Client) GetChannels(ids []string) (result UsersResult, err error) {
	v := url.Values{}
	v.Set("ids", strings.Join(ids, ","))


@@ 47,7 47,7 @@ func (c *Client) GetChannels(ids []string) (result UsersResult, err error) {
}

// CreateChannel creates a new channel
// https://pnut.io/docs/api/resources/channels/lifecycle#post-channels
// https://pnut.io/docs/resources/channels/lifecycle#post-channels
func (c *Client) CreateChannel(typeStr string, acl ACL) (result ChannelResult, err error) {
	json, err := json.Marshal(&createChannel{Type: typeStr, ACL: acl})
	if err != nil {


@@ 59,7 59,7 @@ func (c *Client) CreateChannel(typeStr string, acl ACL) (result ChannelResult, e
}

// UpdateChannel updates an existing channel
// https://pnut.io/docs/api/resources/channels/lifecycle#put-channels-id
// https://pnut.io/docs/resources/channels/lifecycle#put-channels-id
func (c *Client) UpdateChannel(id string, acl ACL) (result ChannelResult, err error) {
	json, err := json.Marshal(&createChannel{ACL: acl})
	if err != nil {


@@ 71,7 71,7 @@ func (c *Client) UpdateChannel(id string, acl ACL) (result ChannelResult, err er
}

// DeleteChannel deletes an existing channel
// https://pnut.io/docs/api/resources/channels/lifecycle#delete-channels-id
// https://pnut.io/docs/resources/channels/lifecycle#delete-channels-id
func (c *Client) DeleteChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id, data: &result, method: "DELETE", responseCh: responseCh}


@@ 79,7 79,7 @@ func (c *Client) DeleteChannel(id string) (result ChannelResult, err error) {
}

// GetSubscribersOfChannel retrives a list of subscribers from a channel ID
// https://pnut.io/docs/api/resources/channels/subscribing#get-channels-id-subscribers
// https://pnut.io/docs/resources/channels/subscribing#get-channels-id-subscribers
func (c *Client) GetSubscribersOfChannel(id string) (result UsersResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/subscribers", data: &result, method: "GET", responseCh: responseCh}


@@ 87,7 87,7 @@ func (c *Client) GetSubscribersOfChannel(id string) (result UsersResult, err err
}

// SubscribeChannel subscribes the authenticated user to a channel
// https://pnut.io/docs/api/resources/channels/subscribing#put-channels-id-subscribe
// https://pnut.io/docs/resources/channels/subscribing#put-channels-id-subscribe
func (c *Client) SubscribeChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/subscribe", data: &result, method: "PUT", responseCh: responseCh}


@@ 95,7 95,7 @@ func (c *Client) SubscribeChannel(id string) (result ChannelResult, err error) {
}

// UnSubscribeChannel unsubscribes the authenticated user from a channel
// https://pnut.io/docs/api/resources/channels/subscribing#delete-channels-id-subscribe
// https://pnut.io/docs/resources/channels/subscribing#delete-channels-id-subscribe
func (c *Client) UnSubscribeChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/subscribe", data: &result, method: "DELETE", responseCh: responseCh}


@@ 103,7 103,7 @@ func (c *Client) UnSubscribeChannel(id string) (result ChannelResult, err error)
}

// MuteChannel mutes notifications for a channel
// https://pnut.io/docs/api/resources/channels/muting#put-channels-id-mute
// https://pnut.io/docs/resources/channels/muting#put-channels-id-mute
func (c *Client) MuteChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/mute", data: &result, method: "PUT", responseCh: responseCh}


@@ 111,7 111,7 @@ func (c *Client) MuteChannel(id string) (result ChannelResult, err error) {
}

// UnMuteChannel unmutes notifications for a channel
// https://pnut.io/docs/api/resources/channels/muting#delete-channels-id-mute
// https://pnut.io/docs/resources/channels/muting#delete-channels-id-mute
func (c *Client) UnMuteChannel(id string) (result ChannelResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/mute", data: &result, method: "DELETE", responseCh: responseCh}


@@ 119,7 119,7 @@ func (c *Client) UnMuteChannel(id string) (result ChannelResult, err error) {
}

// GetMessage retrieves a specific message from a channel
// https://pnut.io/docs/api/resources/messages/lookup#get-channels-id-messages-id
// https://pnut.io/docs/resources/messages/lookup#get-channels-id-messages-id
func (c *Client) GetMessage(channelID string, messageID string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + channelID + "/messages/" + messageID, data: &result, method: "GET", responseCh: responseCh}


@@ 127,7 127,7 @@ func (c *Client) GetMessage(channelID string, messageID string) (result PostResu
}

// GetMessagesInThread retrieves messages in a thread from a channel
// https://pnut.io/docs/api/resources/messages/lookup#get-channels-id-messages-id-thread
// https://pnut.io/docs/resources/messages/lookup#get-channels-id-messages-id-thread
func (c *Client) GetMessagesInThread(channelID string, messageID string) (result PostsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + channelID + "/messages/" + messageID + "/thread", data: &result, method: "GET", responseCh: responseCh}


@@ 135,7 135,7 @@ func (c *Client) GetMessagesInThread(channelID string, messageID string) (result
}

// GetMessages retrieves multiple messages
// https://pnut.io/docs/api/resources/messages/lookup#get-messages
// https://pnut.io/docs/resources/messages/lookup#get-messages
func (c *Client) GetMessages(ids []string) (result PostsResult, err error) {
	v := url.Values{}
	v.Set("ids", strings.Join(ids, ","))


@@ 146,7 146,7 @@ func (c *Client) GetMessages(ids []string) (result PostsResult, err error) {
}

// GetMessagesOfChannel retrieves messages bashed on channel ID
// https://pnut.io/docs/api/resources/messages/lookup#get-channels-id-messages
// https://pnut.io/docs/resources/messages/lookup#get-channels-id-messages
func (c *Client) GetMessagesOfChannel(id string) (result PostsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/messages", data: &result, method: "GET", responseCh: responseCh}


@@ 154,7 154,7 @@ func (c *Client) GetMessagesOfChannel(id string) (result PostsResult, err error)
}

// CreateMessage creates a new message
// https://pnut.io/docs/api/resources/messages/lifecycle#post-channels-id-messages
// https://pnut.io/docs/resources/messages/lifecycle#post-channels-id-messages
func (c *Client) CreateMessage(id string, text string) (result PostResult, err error) {
	var message createMessage
	message.Text = text


@@ 169,7 169,7 @@ func (c *Client) CreateMessage(id string, text string) (result PostResult, err e
}

// DeleteMessage deletes a specific message
// https://pnut.io/docs/api/resources/messages/lifecycle#delete-channels-id-messages-id
// https://pnut.io/docs/resources/messages/lifecycle#delete-channels-id-messages-id
func (c *Client) DeleteMessage(channelID string, messageID string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + channelID + "/messages/" + messageID, data: &result, method: "DELETE", responseCh: responseCh}


@@ 177,7 177,7 @@ func (c *Client) DeleteMessage(channelID string, messageID string) (result PostR
}

// GetStickyMessages retrives sticky messages
// https://pnut.io/docs/api/resources/messages/sticky#get-channels-id-sticky_messages
// https://pnut.io/docs/resources/messages/sticky#get-channels-id-sticky_messages
func (c *Client) GetStickyMessages(id string) (result PostsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + id + "/sticky_messages", data: &result, method: "GET", responseCh: responseCh}


@@ 185,7 185,7 @@ func (c *Client) GetStickyMessages(id string) (result PostsResult, err error) {
}

// Sticky sets a message as sticky
// https://pnut.io/docs/api/resources/messages/sticky#put-channels-id-messages-id-sticky
// https://pnut.io/docs/resources/messages/sticky#put-channels-id-messages-id-sticky
func (c *Client) Sticky(channelID string, messageID string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + channelID + "/messages/" + messageID + "/sticky", data: &result, method: "PUT", responseCh: responseCh}


@@ 193,7 193,7 @@ func (c *Client) Sticky(channelID string, messageID string) (result PostResult, 
}

// UnSticky unsets a message as sticky
// https://pnut.io/docs/api/resources/messages/sticky#delete-channels-id-messages-id-sticky
// https://pnut.io/docs/resources/messages/sticky#delete-channels-id-messages-id-sticky
func (c *Client) UnSticky(channelID string, messageID string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ChannelAPI + "/" + channelID + "/messages/" + messageID + "/sticky", data: &result, method: "DELETE", responseCh: responseCh}

M client_info.go => client_info.go +2 -2
@@ 1,13 1,13 @@
package woodstock

// ClientInfoResult object, https://pnut.io/docs/api/resources/clients
// ClientInfoResult object, https://pnut.io/docs/resources/clients
type ClientInfoResult struct {
	*CommonResponse
	Data ClientInfo `json:"data"`
}

// GetClient retrieves client object based on the id
// https://pnut.io/docs/api/resources/clients#get-clients-id
// https://pnut.io/docs/resources/clients#get-clients-id
func (c *Client) GetClient(id string) (result ClientInfoResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ClientAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}

M files.go => files.go +8 -8
@@ 26,7 26,7 @@ type FileDetails struct {
}

// GetFile retrieve a file object
// https://pnut.io/docs/api/resources/files/lookup#get-files-id
// https://pnut.io/docs/resources/files/lookup#get-files-id
func (c *Client) GetFile(id string) (result FileResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: FileAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}


@@ 34,7 34,7 @@ func (c *Client) GetFile(id string) (result FileResult, err error) {
}

// GetFiles retrieve multiple file objects
// https://pnut.io/docs/api/resources/files/lookup#get-files
// https://pnut.io/docs/resources/files/lookup#get-files
func (c *Client) GetFiles(ids []string) (result FilesResult, err error) {
	v := url.Values{}
	v.Set("ids", strings.Join(ids, ","))


@@ 44,7 44,7 @@ func (c *Client) GetFiles(ids []string) (result FilesResult, err error) {
}

// GetUserFiles retrieve the authenticated users file objects
// https://pnut.io/docs/api/resources/files/lookup#get-users-me-files
// https://pnut.io/docs/resources/files/lookup#get-users-me-files
func (c *Client) GetUserFiles() (result FilesResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI + "/files", data: &result, method: "GET", responseCh: responseCh}


@@ 52,7 52,7 @@ func (c *Client) GetUserFiles() (result FilesResult, err error) {
}

// CreateFile upload a complete file
// https://pnut.io/docs/api/resources/files/lifecycle#post-files
// https://pnut.io/docs/resources/files/lifecycle#post-files
func (c *Client) CreateFile(params map[string]string, reader io.Reader) (result FileResult, err error) {
	// v.Set("field", "content")
	params["field"] = "content"


@@ 62,7 62,7 @@ func (c *Client) CreateFile(params map[string]string, reader io.Reader) (result 
}

// CreateFilePlaceholder create a file placeholder
// https://pnut.io/docs/api/resources/files/lifecycle#post-files
// https://pnut.io/docs/resources/files/lifecycle#post-files
func (c *Client) CreateFilePlaceholder(params File) (result FileResult, err error) {
	json, err := json.Marshal(params)
	if err != nil {


@@ 75,7 75,7 @@ func (c *Client) CreateFilePlaceholder(params File) (result FileResult, err erro

// TODO: is broken
// UpdateFileContent uploads a file for an existing file placeholder
// https://pnut.io/docs/api/resources/files/lifecycle#put-files-id-content
// https://pnut.io/docs/resources/files/lifecycle#put-files-id-content
// func (c *Client) UpdateFileContent(id string, reader io.Reader) (result FileResult, err error) {
// 	responseCh := make(chan response)
// 	c.queryQueue <- query{url: FileAPI + "/" + id + "/content", reader: reader, data: &result, method: "PUT", responseCh: responseCh}


@@ 83,7 83,7 @@ func (c *Client) CreateFilePlaceholder(params File) (result FileResult, err erro
// }

// UpdateFileDetails updates a files details, only name, is_public, and raw
// https://pnut.io/docs/api/resources/files/lifecycle#put-files-id
// https://pnut.io/docs/resources/files/lifecycle#put-files-id
func (c *Client) UpdateFileDetails(id string, details FileDetails) (result FileResult, err error) {
	json, err := json.Marshal(details)
	if err != nil {


@@ 95,7 95,7 @@ func (c *Client) UpdateFileDetails(id string, details FileDetails) (result FileR
}

// DeleteFile delete a file. This will not disassociate a file with any other objects (posts, messages...)
// https://pnut.io/docs/api/resources/files/lifecycle#delete-files-id
// https://pnut.io/docs/resources/files/lifecycle#delete-files-id
func (c *Client) DeleteFile(id string) (result FileResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: FileAPI + "/" + id, data: &result, method: "DELETE", responseCh: responseCh}

M posts.go => posts.go +16 -16
@@ 31,7 31,7 @@ type NewPost struct {
}

// GetPost retrieves a post
// https://pnut.io/docs/api/resources/posts/lookup#get-posts-id
// https://pnut.io/docs/resources/posts/lookup#get-posts-id
func (c *Client) GetPost(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}


@@ 39,7 39,7 @@ func (c *Client) GetPost(id string) (result PostResult, err error) {
}

// GetPosts retrieves mutliple posts
// https://pnut.io/docs/api/resources/posts/lookup#get-posts
// https://pnut.io/docs/resources/posts/lookup#get-posts
func (c *Client) GetPosts(ids []string) (result PostsResult, err error) {
	v := url.Values{}
	v.Set("ids", strings.Join(ids, ","))


@@ 49,7 49,7 @@ func (c *Client) GetPosts(ids []string) (result PostsResult, err error) {
}

// GetPostRevisions retrieves a list of reviesions of a post
// https://pnut.io/docs/api/resources/posts/lookup#get-posts-id-revisions
// https://pnut.io/docs/resources/posts/lookup#get-posts-id-revisions
func (c *Client) GetPostRevisions(id string) (result PostsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/revisions", data: &result, method: "GET", responseCh: responseCh}


@@ 57,7 57,7 @@ func (c *Client) GetPostRevisions(id string) (result PostsResult, err error) {
}

// Post creates a post
// https://pnut.io/docs/api/resources/posts/lifecycle#post-posts
// https://pnut.io/docs/resources/posts/lifecycle#post-posts
func (c *Client) Post(params NewPost) (result PostResult, err error) {
	json, err := json.Marshal(params)
	if err != nil {


@@ 69,7 69,7 @@ func (c *Client) Post(params NewPost) (result PostResult, err error) {
}

// RevisePost updates an existing post
// https://pnut.io/docs/api/resources/posts/lifecycle#put-posts-id
// https://pnut.io/docs/resources/posts/lifecycle#put-posts-id
func (c *Client) RevisePost(id string, params NewPost) (result PostResult, err error) {
	json, err := json.Marshal(params)
	if err != nil {


@@ 81,7 81,7 @@ func (c *Client) RevisePost(id string, params NewPost) (result PostResult, err e
}

// DeletePost deletes a post
// https://pnut.io/docs/api/resources/posts/lifecycle#delete-posts-id
// https://pnut.io/docs/resources/posts/lifecycle#delete-posts-id
func (c *Client) DeletePost(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id, data: &result, method: "DELETE", responseCh: responseCh}


@@ 89,7 89,7 @@ func (c *Client) DeletePost(id string) (result PostResult, err error) {
}

// MeStream retrieves a personal stream
// https://pnut.io/docs/api/resources/posts/streams#get-posts-streams-me
// https://pnut.io/docs/resources/posts/streams#get-posts-streams-me
func (c *Client) MeStream(count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 105,7 105,7 @@ func (c *Client) MeStream(count ...int) (result PostsResult, err error) {
}

// UnifiedStream retrieves a unified stream
// https://pnut.io/docs/api/resources/posts/streams#get-posts-streams-unified
// https://pnut.io/docs/resources/posts/streams#get-posts-streams-unified
func (c *Client) UnifiedStream(count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 121,7 121,7 @@ func (c *Client) UnifiedStream(count ...int) (result PostsResult, err error) {
}

// GlobalStream retrieves the global stream
// https://pnut.io/docs/api/resources/posts/streams#get-posts-streams-unified
// https://pnut.io/docs/resources/posts/streams#get-posts-streams-unified
func (c *Client) GlobalStream(count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 137,7 137,7 @@ func (c *Client) GlobalStream(count ...int) (result PostsResult, err error) {
}

// TagStream retrieves a stream for a given tag
// https://pnut.io/docs/api/resources/posts/streams#get-posts-tag-tag
// https://pnut.io/docs/resources/posts/streams#get-posts-tag-tag
func (c *Client) TagStream(tag string, count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 153,7 153,7 @@ func (c *Client) TagStream(tag string, count ...int) (result PostsResult, err er
}

// GetThread retrieves post in a given thread
// https://pnut.io/docs/api/resources/posts/threads#get-posts-id-thread
// https://pnut.io/docs/resources/posts/threads#get-posts-id-thread
func (c *Client) GetThread(id string) (result PostsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/thread", data: &result, method: "GET", responseCh: responseCh}


@@ 161,7 161,7 @@ func (c *Client) GetThread(id string) (result PostsResult, err error) {
}

// Repost repeats a post
// https://pnut.io/docs/api/resources/posts/reposts#put-posts-id-repost
// https://pnut.io/docs/resources/posts/reposts#put-posts-id-repost
func (c *Client) Repost(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/repost", data: &result, method: "PUT", responseCh: responseCh}


@@ 169,7 169,7 @@ func (c *Client) Repost(id string) (result PostResult, err error) {
}

// UnRepost removes a repeated post
// https://pnut.io/docs/api/resources/posts/reposts#delete-posts-id-repost
// https://pnut.io/docs/resources/posts/reposts#delete-posts-id-repost
func (c *Client) UnRepost(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/repost", data: &result, method: "DELETE", responseCh: responseCh}


@@ 177,7 177,7 @@ func (c *Client) UnRepost(id string) (result PostResult, err error) {
}

// Bookmark creates a bookmark (stars) a post
// https://pnut.io/docs/api/resources/posts/bookmarks#put-posts-id-bookmark
// https://pnut.io/docs/resources/posts/bookmarks#put-posts-id-bookmark
func (c *Client) Bookmark(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/bookmark", data: &result, method: "PUT", responseCh: responseCh}


@@ 185,7 185,7 @@ func (c *Client) Bookmark(id string) (result PostResult, err error) {
}

// UnBookmark deletes a bookmark (unstars) a post
// https://pnut.io/docs/api/resources/posts/bookmarks#put-posts-id-bookmark
// https://pnut.io/docs/resources/posts/bookmarks#put-posts-id-bookmark
func (c *Client) UnBookmark(id string) (result PostResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/bookmark", data: &result, method: "DELETE", responseCh: responseCh}


@@ 193,7 193,7 @@ func (c *Client) UnBookmark(id string) (result PostResult, err error) {
}

// GetActions retrieves actions
// https://pnut.io/docs/api/resources/posts/interactions#get-posts-id-interactions
// https://pnut.io/docs/resources/posts/interactions#get-posts-id-interactions
func (c *Client) GetActions(id string, v ...url.Values) (result ActionsResult, err error) {
	param := ""
	if len(v) > 0 {

M precense.go => precense.go +1 -1
@@ 7,7 7,7 @@ type PresencesResult struct {
}

// GetPresences retrieves precense
// https://pnut.io/docs/api/resources/users/presence#get-presence
// https://pnut.io/docs/resources/users/presence#get-presence
func (c *Client) GetPresences() (result PresencesResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: PresenceAPI, data: &result, method: "GET", responseCh: responseCh}

M stream_marker.go => stream_marker.go +2 -2
@@ 8,8 8,8 @@ type MarkersResult struct {

// SetMarker sets the current read marker
// this func will be updated
// https://pnut.io/docs/api/resources/stream-marker
// https://pnut.io/docs/api/resources/stream-marker#post-markers
// 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}

M users.go => users.go +31 -31
@@ 49,7 49,7 @@ type ClientInfosResult struct {
}

// GetUser retrieves a user
// https://pnut.io/docs/api/resources/users/lookup#get-users-id
// https://pnut.io/docs/resources/users/lookup#get-users-id
func (c *Client) GetUser(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}


@@ 57,7 57,7 @@ func (c *Client) GetUser(id string) (result UserResult, err error) {
}

// GetUsers retrieves multiple users
// https://pnut.io/docs/api/resources/users/lookup#get-users
// https://pnut.io/docs/resources/users/lookup#get-users
func (c *Client) GetUsers(ids []string) (result UsersResult, err error) {
	v := url.Values{}
	v.Set("ids", strings.Join(ids, ","))


@@ 69,7 69,7 @@ func (c *Client) GetUsers(ids []string) (result UsersResult, err error) {

// ReplaceProfile replaces a user profile
// this func will be updated
// https://pnut.io/docs/api/resources/users/profile#put-users-me
// https://pnut.io/docs/resources/users/profile#put-users-me
func (c *Client) ReplaceProfile(json string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI, data: &result, method: "PUT", responseCh: responseCh, json: json}


@@ 78,7 78,7 @@ func (c *Client) ReplaceProfile(json string) (result UserResult, err error) {

// UpdateProfile updates a user profile
// this func will be updated
// https://pnut.io/docs/api/resources/users/profile#patch-users-me
// https://pnut.io/docs/resources/users/profile#patch-users-me
func (c *Client) UpdateProfile(json string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI, data: &result, method: "PATCH", responseCh: responseCh, json: json}


@@ 86,7 86,7 @@ func (c *Client) UpdateProfile(json string) (result UserResult, err error) {
}

// GetAvatarURL retrieves a users avatar URL
// https://pnut.io/docs/api/resources/users/profile#get-users-id-avatar
// https://pnut.io/docs/resources/users/profile#get-users-id-avatar
func (c *Client) GetAvatarURL(id string, v ...url.Values) (url string, err error) {
	param := ""
	if len(v) > 0 {


@@ 102,7 102,7 @@ func (c *Client) GetAvatarURL(id string, v ...url.Values) (url string, err error
}

// UploadAvatar updates a user avatar
// https://pnut.io/docs/api/resources/users/profile#post-users-me-avatar
// https://pnut.io/docs/resources/users/profile#post-users-me-avatar
func (c *Client) UploadAvatar(params map[string]string, reader io.Reader) (result UserResult, err error) {
	params["field"] = "avatar"
	responseCh := make(chan response)


@@ 111,7 111,7 @@ func (c *Client) UploadAvatar(params map[string]string, reader io.Reader) (resul
}

// GetCoverURL retireves a cover URL
// https://pnut.io/docs/api/resources/users/profile#get-users-id-cover
// https://pnut.io/docs/resources/users/profile#get-users-id-cover
func (c *Client) GetCoverURL(id string, v ...url.Values) (url string, err error) {
	param := ""
	if len(v) > 0 {


@@ 127,7 127,7 @@ func (c *Client) GetCoverURL(id string, v ...url.Values) (url string, err error)
}

// UploadCover updates a cover image
// https://pnut.io/docs/api/resources/users/profile#post-users-me-cover
// https://pnut.io/docs/resources/users/profile#post-users-me-cover
func (c *Client) UploadCover(params map[string]string, reader io.Reader) (result UserResult, err error) {
	params["field"] = "cover"
	responseCh := make(chan response)


@@ 136,7 136,7 @@ func (c *Client) UploadCover(params map[string]string, reader io.Reader) (result
}

// GetFollowing retrieve following list
// https://pnut.io/docs/api/resources/users/following#get-users-id-following
// https://pnut.io/docs/resources/users/following#get-users-id-following
func (c *Client) GetFollowing(id string, count ...int) (result UsersResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 152,7 152,7 @@ func (c *Client) GetFollowing(id string, count ...int) (result UsersResult, err 
}

// GetFollowers retrieve followers list
// https://pnut.io/docs/api/resources/users/followers#get-users-id-followers
// https://pnut.io/docs/resources/users/followers#get-users-id-followers
func (c *Client) GetFollowers(id string, count ...int) (result UsersResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 168,7 168,7 @@ func (c *Client) GetFollowers(id string, count ...int) (result UsersResult, err 
}

// Follow a user
// https://pnut.io/docs/api/resources/users/following#put-users-id-follow
// https://pnut.io/docs/resources/users/following#put-users-id-follow
func (c *Client) Follow(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/follow", data: &result, method: "PUT", responseCh: responseCh}


@@ 176,7 176,7 @@ func (c *Client) Follow(id string) (result UserResult, err error) {
}

// UnFollow a user
//https://pnut.io/docs/api/resources/users/following#delete-users-id-follow
//https://pnut.io/docs/resources/users/following#delete-users-id-follow
func (c *Client) UnFollow(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/follow", data: &result, method: "DELETE", responseCh: responseCh}


@@ 184,7 184,7 @@ func (c *Client) UnFollow(id string) (result UserResult, err error) {
}

// GetMuted retrieve muted users
// https://pnut.io/docs/api/resources/users/muting#get-users-id-muted
// https://pnut.io/docs/resources/users/muting#get-users-id-muted
func (c *Client) GetMuted() (result UsersResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI + "/muted", data: &result, method: "GET", responseCh: responseCh}


@@ 192,7 192,7 @@ func (c *Client) GetMuted() (result UsersResult, err error) {
}

// Mute a user
// https://pnut.io/docs/api/resources/users/muteing#put-users-id-mute
// https://pnut.io/docs/resources/users/muteing#put-users-id-mute
func (c *Client) Mute(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/mute", data: &result, method: "PUT", responseCh: responseCh}


@@ 200,7 200,7 @@ func (c *Client) Mute(id string) (result UserResult, err error) {
}

// UnMute a user
// https://pnut.io/docs/api/resources/users/muting#delete-users-id-mute
// https://pnut.io/docs/resources/users/muting#delete-users-id-mute
func (c *Client) UnMute(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/mute", data: &result, method: "DELETE", responseCh: responseCh}


@@ 208,7 208,7 @@ func (c *Client) UnMute(id string) (result UserResult, err error) {
}

// GetBlocked retrieve blocked users
// https://pnut.io/docs/api/resources/users/muting#get-users-id-blocked
// https://pnut.io/docs/resources/users/muting#get-users-id-blocked
func (c *Client) GetBlocked() (result UsersResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI + "/blocked", data: &result, method: "GET", responseCh: responseCh}


@@ 216,7 216,7 @@ func (c *Client) GetBlocked() (result UsersResult, err error) {
}

// Block a user
// https://pnut.io/docs/api/resources/users/blocking#put-users-id-block
// https://pnut.io/docs/resources/users/blocking#put-users-id-block
func (c *Client) Block(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/block", data: &result, method: "PUT", responseCh: responseCh}


@@ 224,7 224,7 @@ func (c *Client) Block(id string) (result UserResult, err error) {
}

// UnBlock a user
// https://pnut.io/docs/api/resources/posts/bookmarks#delete-posts-id-bookmark
// https://pnut.io/docs/resources/posts/bookmarks#delete-posts-id-bookmark
func (c *Client) UnBlock(id string) (result UserResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/block", data: &result, method: "DELETE", responseCh: responseCh}


@@ 232,7 232,7 @@ func (c *Client) UnBlock(id string) (result UserResult, err error) {
}

// GetPresence retrieve presence user
// https://pnut.io/docs/api/resources/users/presence#get-users-id-presence
// https://pnut.io/docs/resources/users/presence#get-users-id-presence
func (c *Client) GetPresence(id string) (result PresenceResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/presence", data: &result, method: "GET", responseCh: responseCh}


@@ 240,7 240,7 @@ func (c *Client) GetPresence(id string) (result PresenceResult, err error) {
}

// SetPresence for user
// https://pnut.io/docs/api/resources/users/presence#put-users-id-presence
// https://pnut.io/docs/resources/users/presence#put-users-id-presence
func (c *Client) SetPresence(presence string) (result PresenceResult, err error) {
	v := url.Values{}
	v.Set("presence", presence)


@@ 250,7 250,7 @@ func (c *Client) SetPresence(presence string) (result PresenceResult, err error)
}

// GetMentions retrieves mentions
// https://pnut.io/docs/api/resources/posts/streams#get-users-id-mentions
// https://pnut.io/docs/resources/posts/streams#get-users-id-mentions
func (c *Client) GetMentions(id string, count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 266,7 266,7 @@ func (c *Client) GetMentions(id string, count ...int) (result PostsResult, err e
}

// GetPostsFromUser retrieve posts from a user
// https://pnut.io/docs/api/resources/posts/streams#get-users-id-posts
// https://pnut.io/docs/resources/posts/streams#get-users-id-posts
func (c *Client) GetPostsFromUser(id string, count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 282,7 282,7 @@ func (c *Client) GetPostsFromUser(id string, count ...int) (result PostsResult, 
}

// GetBookmarks retrieve a users bookmarks
// https://pnut.io/docs/api/resources/posts/bookmarks#get-users-id-bookmarks
// https://pnut.io/docs/resources/posts/bookmarks#get-users-id-bookmarks
func (c *Client) GetBookmarks(id string, count ...int) (result PostsResult, err error) {
	v := url.Values{}
	if len(count) > 0 {


@@ 298,7 298,7 @@ func (c *Client) GetBookmarks(id string, count ...int) (result PostsResult, err 
}

// GetActionsForMe retireve a users actions
// https://pnut.io/docs/api/resources/users/interactions#get-users-me-interactions
// https://pnut.io/docs/resources/users/interactions#get-users-me-interactions
func (c *Client) GetActionsForMe(v ...url.Values) (result ActionsResult, err error) {
	param := ""
	if len(v) > 0 {


@@ 313,7 313,7 @@ func (c *Client) GetActionsForMe(v ...url.Values) (result ActionsResult, err err
}

// GetChannelsByMe retireves channels created by user
// https://pnut.io/docs/api/resources/channels/lookup#get-users-me-channels
// https://pnut.io/docs/resources/channels/lookup#get-users-me-channels
func (c *Client) GetChannelsByMe() (result ChannelsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI + "/channels", data: &result, method: "GET", responseCh: responseCh}


@@ 321,7 321,7 @@ func (c *Client) GetChannelsByMe() (result ChannelsResult, err error) {
}

// GetNumberOfUnreadPM retireves the number of unread private messages
// https://pnut.io/docs/api/resources/channels/lookup#get-users-me-channels-num_unread-pm
// https://pnut.io/docs/resources/channels/lookup#get-users-me-channels-num_unread-pm
func (c *Client) GetNumberOfUnreadPM() (result NumberResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UnreadPMNumberAPI, data: &result, method: "GET", responseCh: responseCh}


@@ 329,7 329,7 @@ func (c *Client) GetNumberOfUnreadPM() (result NumberResult, err error) {
}

// MarkReadPM marks private messages as read
// https://pnut.io/docs/api/resources/channels/lookup#delete-users-me-channels-num_unread-pm
// https://pnut.io/docs/resources/channels/lookup#delete-users-me-channels-num_unread-pm
func (c *Client) MarkReadPM() (result NumberResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UnreadPMNumberAPI, data: &result, method: "DELETE", responseCh: responseCh}


@@ 337,7 337,7 @@ func (c *Client) MarkReadPM() (result NumberResult, err error) {
}

// GetSubscribedChannels retrieves list of subscribed channels
// https://pnut.io/docs/api/resources/channels/subscribing#get-users-me-channels-subscribed
// https://pnut.io/docs/resources/channels/subscribing#get-users-me-channels-subscribed
func (c *Client) GetSubscribedChannels() (result ChannelsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: SubscribedChannelsAPI, data: &result, method: "GET", responseCh: responseCh}


@@ 345,7 345,7 @@ func (c *Client) GetSubscribedChannels() (result ChannelsResult, err error) {
}

// GetMutedChannels retrieves list of muted channels
// https://pnut.io/docs/api/resources/channels/muting#get-users-me-channels-muted
// https://pnut.io/docs/resources/channels/muting#get-users-me-channels-muted
func (c *Client) GetMutedChannels() (result ChannelsResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: MutedChannelsAPI, data: &result, method: "GET", responseCh: responseCh}


@@ 353,7 353,7 @@ func (c *Client) GetMutedChannels() (result ChannelsResult, err error) {
}

// GetMessagesByMe retireves messages created by user
// https://pnut.io/docs/api/resources/messages/lookup#get-users-me-messages
// https://pnut.io/docs/resources/messages/lookup#get-users-me-messages
func (c *Client) GetMessagesByMe() (result MessagesResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: MeMessagesAPI, data: &result, method: "GET", responseCh: responseCh}


@@ 361,7 361,7 @@ func (c *Client) GetMessagesByMe() (result MessagesResult, err error) {
}

// GetClients retrieves client information
// https://pnut.io/docs/api/resources/clients#get-users-id-clients
// https://pnut.io/docs/resources/clients#get-users-id-clients
func (c *Client) GetClients(id string) (result ClientInfosResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserAPI + "/" + id + "/clients", data: &result, method: "GET", responseCh: responseCh}