~thrrgilag/woodstock

woodstock/api.go -rw-r--r-- 1.3 KiB
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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package woodstock

import (
	"net/http"
)

// 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/"
	OAuthAccessTokenAPI   = APIBasesURL + "oauth/access_token"
	PostAPI               = APIBasesURL + "posts"
	StreamBaseURL         = PostAPI + "/" + "streams"
	StreamMeAPI           = StreamBaseURL + "/me"
	StreamUnifiedAPI      = StreamBaseURL + "/unified"
	StreamGlobalAPI       = StreamBaseURL + "/global"
	StreamTabBaseURL      = PostAPI + "/" + "tag"
	UserAPI               = APIBasesURL + "users"
	UserMeAPI             = UserAPI + "/me"
	MeChannelsBaseURL     = UserMeAPI + "/channels"
	UnreadPMNumberAPI     = MeChannelsBaseURL + "/num_unread/pm"
	SubscribedChannelsAPI = MeChannelsBaseURL + "/subscribed"
	MutedChannelsAPI      = MeChannelsBaseURL + "/muted"
	MeMessagesAPI         = UserMeAPI + "/messages"
	ChannelAPI            = APIBasesURL + "channels"
	PresenceAPI           = APIBasesURL + "presence"
	ClientAPI             = APIBasesURL + "clients"
	MarkerAPI             = APIBasesURL + "markers"
	FileAPI               = APIBasesURL + "files"
)

// API definition
type API struct {
	accessToken string
	HTTPClient  *http.Client
}