Files
crossnokaye-interview-assig…/services/item/design/design.go
2023-08-10 14:36:18 -05:00

67 lines
1.1 KiB
Go

package design
import (
. "crossnokaye-interview-assignment/design"
. "goa.design/goa/v3/dsl"
)
var _ = API("item", func() {
Title("Item Service")
Server("item", func() {
Host("localhost", func() {
URI("grpc://localhost:8082")
})
})
})
var _ = Service("item", func() {
Description("A GRPC back service that handles CRUD operations for the items that exist and their attributes")
Method("getItem", func() {
Payload(Int)
Result(Item)
Error("NotFound")
GRPC(func() {
Response(CodeOK)
})
})
// Method("listItems", func() {
// })
Method("createItem", func() {
Payload(Item)
Result(Item)
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
})
})
Method("updateItem", func() {
Payload(Item)
Result(Item)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
})
})
Method("deleteItem", func() {
Payload(Int)
Result(Empty)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
})