github.com/dapr/dapr/tests/apps/resiliencyapp_grpc v0.0.0-20260903134139-ede00bc4ae54
Dapr Go module source pathGo process is a gRPC server
SHA-256f2b712d7c58eb486660cd4c970310ef0d9c7c1b00045bc6e6689859567c3ab22
MaleculeK(Am)
Evidence
1/*
2Copyright 2021 The Dapr Authors
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6 http://www.apache.org/licenses/LICENSE …
9:42… IND, either express or implied.
10See the License for the specific language governing permissions and
11limitations under the License.
12*/
13
14package main
15
16import (
17 "context"
18 "encoding/json"
19 "errors"
20 "fmt"
21 "log"
22 "net"
23 "time"
24
25 commonv1pb "github.com/dapr/dapr/pkg/proto/common/v1"
26 runtimev1pb "github.com/dapr/dapr/pkg/proto/runtime/v1"
27
28 "google.golang.org/grpc"
29 grpccodes "google.golang.org/grpc/codes"
30 pb "google.golang.org/grpc/examples/helloworld/helloworld"
31 "google.golang.org/protobuf/types/known/anypb"
32 "google.golang.org/protobuf/types/known/emptypb"
33)
34
⋯6 lines
60:67… ) (*pb.HelloReply, error) {
61 var message FailureMessage
62 err := json.Unmarshal([]byte(in.Name), &message)
63 if err != nil {
64 return nil, errors.New("failed to decode message")
⋯4 lines
101:9… rintf("\t%s - Called %d times.", key, len(val))
102 }
103 b, err := json.Marshal(s.callTracking)
104
105 if err != nil {
⋯7 lines
247:12… {
248 log.Printf("Initializing grpc")
249
250 /* #nosec */
251 lis, err := net.Listen("tcp", fmt.Sprintf(":%s", appPort))
252 if err != nil {
253 log.Fatalf("failed to listen: %v", err)
⋯4 lines
258 callTracking: map[string][]CallRecord{},
259 }
260 s := grpc.NewServer()
261 runtimev1pb.RegisterAppCallbackServer(s, server)
262 pb.RegisterGreeterServer(s, server)
263
264 log.Println("Client starting...")
265
266 if err := s.Serve(lis); err != nil {
267 log.Fatalf("failed to serve: %v", err)
268 }
269}
No evidence locations were recorded for this file. Raw result