MCPcopy Index your code
hub / github.com/dreamsofcode-io/grpc / pokemonToResponse

Function pokemonToResponse

pokemon-api/pokedex/model.go:19–32  ·  view source on GitHub ↗
(p Pokemon)

Source from the content-addressed store, hash-verified

17}
18
19func pokemonToResponse(p Pokemon) pb.Pokemon {
20 types := make([]pb.Type, len(p.Types))
21 for i, t := range p.Types {
22 types[i] = pb.Type(pb.Type_value[t])
23 }
24
25 return pb.Pokemon{
26 Id: p.ID,
27 Name: p.Name,
28 Type: types,
29 CreatedAt: timestamppb.New(p.CreatedAt),
30 UpdatedAt: timestamppb.New(p.UpdatedAt),
31 }
32}

Callers 4

CreateMethod · 0.85
ReadMethod · 0.85
ReadOneMethod · 0.85
UpdateMethod · 0.85

Calls 1

TypeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…