Files
crossnokaye-interview-assig…/services/inventory/design/design.go

46 lines
866 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package design
import (
"crossnokaye-interview-assignment/design"
. "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(design.InventoryRecord)
Result(Empty)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
})
})
Method("removeItem", func() {
Payload(design.InventoryRecord)
Result(Empty)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
})