Splitting design into separate services

This commit is contained in:
Brandon Watson
2023-08-10 13:14:38 -05:00
parent 2f149f2c6d
commit 54c2632cec
15 changed files with 699 additions and 235 deletions

View File

@ -0,0 +1,75 @@
package design
import (
. "crossnokaye-interview-assignment/design"
. "goa.design/goa/v3/dsl"
)
var _ = API("character", func() {
Title("Character Srvice")
Server("character", func() {
Host("localhost", func() {
URI("grpc://localhost:8083")
})
})
})
var _ = Service("character", func() {
Description("A GRPC back service that handles CRUD operations for the characters and their attributes")
Method("getCharacter", func() {
Payload(Int)
Result(Character)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
// Method("listCharacters", func() {
// })
Method("createCharacter", func() {
Payload(Character)
Result(Character)
Error("BadRequest")
Error("NotFound")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
Method("updateCharacter", func() {
Payload(Character)
Result(Character)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
Method("deleteCharacter", func() {
Payload(Int)
Result(Empty)
Error("NotFound")
Error("BadRequest")
GRPC(func() {
Response(CodeOK)
Response("NotFound", CodeNotFound)
Response("BadRequest", CodeInvalidArgument)
})
})
})