$ mkdir ./library/verify-token
$ vim ./library/verify-token/verify.go
package verify
type VerifyClient struct{}
func NewVerifyClient() *VerifyClient {
return &VerifyClient{}
}
func (t *VerifyClient) VerifyToken(token string) bool {
// verifying token
return true
}
Cloud Datastore エミュレータの実行 | Cloud Datastore ドキュメント | Google Cloud
$ gcloud components install cloud-datastore-emulator
$ $(gcloud beta emulators datastore env-init)
$ gcloud beta emulators datastore start
$ go run .
query{
user {
name
email
nick_name
description
}
contents(limit: 1) {
id
title
publish_date
body
tags {
tag_desc
tag_name
}
}
}
curl -X POST \
https://localhost:8080/v1/contents \
-H 'Content-Type: application/json' \
-d '{
"title" : "ブログのタイトルをどうしようかなと思っている2",
"tags": [
"go"
],
"body":"#たいとるが決まりません2"
}'