forked from evilmarty/metroplex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.go
More file actions
31 lines (26 loc) · 654 Bytes
/
Copy pathclient.go
File metadata and controls
31 lines (26 loc) · 654 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
package metroplex
var (
DefaultHeaders = map[string]string{
"X-Plex-Platform": "golang",
"X-Plex-Platform-Version": "0.0",
"X-Plex-Provides": "player,controller",
"X-Plex-Version": "0.0",
"X-Plex-Device": "platform",
"X-Plex-Client-Identifier": "metroplex",
}
)
type Client struct {
Headers map[string]string
}
func (c *Client) Authorize(token string) *Client {
c.Headers["X-Plex-Token"] = token
return c
}
func (c *Client) Request(method, url string) *Request {
return newRequest(method, url).Headers(c.Headers)
}
func newClient() *Client {
return &Client{
Headers: DefaultHeaders,
}
}