ShangriLa Anime APIのGolang実装です
2020年からはこちらが稼働しています
オリジナル版とAPI仕様はこちら
go build -trimpath -ldflags '-s -w'
or
GOOS=linux GOARCH=arm64 go build -trimpath -ldflags '-s -w' -o anime_master_api_linux
MySQLに下記のDDLを実行してください
https://github.com/Project-ShangriLa/anime_master_db_ddl
DBの接続を環境変数で管理しています
export ANIME_API_DB_HOST=
export ANIME_API_DB_USER=
export ANIME_API_DB_PASS=
管理APIのKEYを環境変数で管理しています
export X_ANIME_API_KEY=abcde
./anime_master_api
curl http://localhost:8080/anime/v1/master/cours | jq .
curl http://localhost:8080/anime/v1/master/2021 | jq .
curl http://localhost:8080/anime/v1/master/2021/3 | jq .
curl "http://localhost:8080/anime/v1/master/2021/3?ogp=1" | jq .
curl -XPOST --header 'X-API-KEY:abcde' http://localhost:8080/anime/v1/master/cache/clear
curl -XPOST --header 'X-API-KEY:abcde' http://localhost:8080/anime/v1/master/cache/refresh