-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (51 loc) · 1.39 KB
/
Makefile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.PHONY: default
default: run
App :=
Token :=
client_id :=
client_secret :=
refresh :=
auth_code :=
list:
@grep '^[^#[:space:]].*:' Makefile
doc:
godoc -http=:1337 -goroot=.
docker-build:
docker build --no-cache -t shikimori-docs -f docker/Dockerfile .
docker-start:
docker run -d -p 1337:1337 shikimori-docs
test:
go test -v
go test -v ./concat
go vet .
bench:
go test -bench=./concat
analysis:
go run -gcflags=-m cmd/main.go
run:
go run cmd/main.go
graphql-request:
curl -X POST https://shikimori.one/api/graphql \
-H "User-Agent: $(App)" \
-H "Authorization: Bearer $(Token)" \
-H 'Content-Type: application/json' \
-d '{"query": "{ animes(search: \"initial d first stage\", limit: 1) { id name russian english japanese score status episodes description } }"}'
request:
curl -X GET https://shikimori.one/api/animes?search=death+note&genre \
-H "User-Agent: $(App)" \
-H "Authorization: Bearer $(Token)"
token:
curl -X POST "https://shikimori.one/oauth/token" \
-H "User-Agent: $(App)" \
-F grant_type="refresh_token" \
-F client_id="$(client_id)" \
-F client_secret="$(client_secret)" \
-F refresh_token="$(refresh)"
auth:
curl -X POST "https://shikimori.one/oauth/token" \
-H "User-Agent: $(App)" \
-F grant_type="authorization_code" \
-F client_id="$(client_id)" \
-F client_secret="$(client_secret)" \
-F code="$(auth_code)" \
-F redirect_uri="urn:ietf:wg:oauth:2.0:oob"