Splitting design into separate services
This commit is contained in:
44
services/inventory/design/design.go
Normal file
44
services/inventory/design/design.go
Normal file
@ -0,0 +1,44 @@
|
||||
package design
|
||||
|
||||
import (
|
||||
. "goa.design/goa/v3/dsl"
|
||||
)
|
||||
|
||||
var _ = API("inventory", func() {
|
||||
Title("Inventory Service")
|
||||
Server("inventory", func() {
|
||||
Host("localhost", func() {
|
||||
URI("grpc://localhost:8081")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
var _ = Service("inventory", func() {
|
||||
Description("A GRPC back service that handles CRUD operations for the characters’ inventories")
|
||||
// Method("listItems", func() {
|
||||
// })
|
||||
|
||||
Method("addItem", func() {
|
||||
Payload(Int)
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
})
|
||||
})
|
||||
|
||||
Method("removeItem", func() {
|
||||
Payload(Int)
|
||||
Result(Empty)
|
||||
Error("NotFound")
|
||||
Error("BadRequest")
|
||||
|
||||
GRPC(func() {
|
||||
Response(CodeOK)
|
||||
Response("NotFound", CodeNotFound)
|
||||
Response("BadRequest", CodeInvalidArgument)
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user