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(func() { Field(1, "name", String) }) Result(Character) Error("NotFound") GRPC(func() { Response(CodeOK) Response("NotFound", CodeNotFound) }) }) Method("listCharacters", func() { Payload(Empty) Result(ArrayOf(Character)) GRPC(func() { Response(CodeOK) }) }) Method("createCharacter", func() { Payload(Character) Result(Character) Error("NotFound") Error("AlreadyExists") GRPC(func() { Response(CodeOK) Response("NotFound", CodeNotFound) Response("AlreadyExists", CodeAlreadyExists) }) }) Method("updateCharacter", func() { Payload(Character) Result(Character) Error("NotFound") GRPC(func() { Response(CodeOK) Response("NotFound", CodeNotFound) }) }) Method("deleteCharacter", func() { Payload(func() { Field(1, "name", String) }) Result(Empty) Error("NotFound") GRPC(func() { Response(CodeOK) Response("NotFound", CodeNotFound) }) }) })