Splitting design into separate services
This commit is contained in:
75
services/character/design/design.go
Normal file
75
services/character/design/design.go
Normal 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)
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user