ReadOracle returns a raw *pb.Oracle object given its identifier.
(ctx context.Context, query *pb.ById)
| 46 | |
| 47 | // ReadOracle returns a raw *pb.Oracle object given its identifier. |
| 48 | func (s *Service) ReadOracle(ctx context.Context, query *pb.ById) (*pb.OracleResponse, error) { |
| 49 | oracle := s.oracles.Find(query.Id) |
| 50 | if oracle == nil { |
| 51 | return errOracleResponse("oracle %d not found.", query.Id), nil |
| 52 | } |
| 53 | return &pb.OracleResponse{Success: true, Oracle: oracle}, nil |
| 54 | } |
| 55 | |
| 56 | // FindOracle returns a list of raw *pb.Oracle objects that match |
| 57 | // the provided name. |
nothing calls this directly
no test coverage detected