-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.go
36 lines (30 loc) · 1.01 KB
/
manifest.go
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 destiny
import (
"encoding/json"
"fmt"
"net/http"
)
type ManifestAssetDatabase struct {
Version int `json:"version"`
Path string `json:"path"`
}
type Manifest struct {
Version string `json:"version"`
AssetContentPath string `json:"mobileAssetContentPath"`
WorldContentPaths map[string]string `json:"mobileWorldContentPaths"`
GearCDN map[string]string `json:"mobileGearCDN"`
GearAssetDataBases []ManifestAssetDatabase `json:"mobileGearAssetDataBases"`
}
func (m *Manifest) Get(path string) (*http.Response, error) {
return http.Get(fmt.Sprintf("http://www.bungie.net%s", path))
}
func (c *Client) Manifest() (*Manifest, error) {
var rval *Manifest
_, err := c.getAndUnwrap("https://www.bungie.net/Platform/Destiny/Manifest/", &rval)
return rval, err
}
func (c *Client) RawManifestData() ([]byte, error) {
var raw json.RawMessage
_, err := c.getAndUnwrap("https://www.bungie.net/Platform/Destiny/Manifest/", &raw)
return raw, err
}