Skip to content

Instantly share code, notes, and snippets.

View ikawaha's full-sized avatar

ikawaha ikawaha

View GitHub Profile
curl -X POST localhost:8888/check-in -d '{"pet-owner":{"pet":{"Type":"dog","Value":"{\"Name\":\"POCHI\",\"Breed\":\"AKITA\"}"}}}'
{"pet":{"Type":"dog","Value":"{\"Name\":\"POCHI\",\"Breed\":\"AKITA\"}"}}
@ikawaha
ikawaha / design.go
Last active March 9, 2020 15:15
Goa v3 の(gRPC を含まない)最小限のデザインのサンプル
package design
import (
. "goa.design/goa/v3/dsl"
)
var _ = Service("calc", func() {
Method("add", func() {
Payload(func() {
Attribute("a", Int, "Left operand")
package design
import (
. "goa.design/goa/v3/dsl"
cors "goa.design/plugins/v3/cors/dsl"
)
var _ = API("calc", func() {
Title("Calculator Service")
Description("Service for adding numbers, a Goa teaser")
grammar ReStructedText;
file
: section+ EOF
;
section
: section_title section_content+
// | empty_line* -> /* omit line-breaks between paragraphs from AST */
;
@ikawaha
ikawaha / design.go
Created April 4, 2017 07:34
KeyがEnumで制限されているHashOf
package design // The convention consists of naming the design
// package "design"
import (
. "github.com/goadesign/goa/design" // Use . imports to enable the DSL
. "github.com/goadesign/goa/design/apidsl"
)
var _ = API("cellar", func() { // API defines the microservice endpoint and
Title("The virtual wine cellar") // other global properties. There should be one
Description("A simple goa service") // and exactly one API definition appearing in
@ikawaha
ikawaha / readme.md
Last active April 4, 2017 01:20
cherry-pick

(1) master の該当の差分を探しておく

$ git log|head -15
commit e4ce857d53544c2f9c3a81c5fcf4b7c7dc4bb6ce
Author: Raphaël Simon <[email protected]>
Date:   Sun Apr 2 18:01:16 2017 -0700

    Update generated file headers to match new Go standard (#1160)

 as described in https://github.com/golang/go/issues/13560
@ikawaha
ikawaha / pg_test.go
Created March 8, 2016 03:40
やっつけ
package pg_test
import (
"fmt"
"reflect"
"time"
"gopkg.in/pg.v4"
"gopkg.in/pg.v4/orm"
"gopkg.in/pg.v4/types"
@ikawaha
ikawaha / bottle.go
Last active February 23, 2016 09:23
goa sample
package main
import (
"fmt"
"cellar/app"
"github.com/goadesign/goa"
)
// BottleController implements thebottle resource.
@ikawaha
ikawaha / normalize.go
Created February 10, 2016 15:09
Neologd normalizer
package neologd
import (
"bytes"
"strings"
"unicode"
"unicode/utf8"
)
const (
package main
import (
"fmt"
"time"
"github.com/goamz/goamz/aws"
"github.com/goamz/goamz/sqs"
"github.com/k0kubun/pp"
)