MCPcopy Create free account
hub / github.com/clouditor/clouditor / Invoke

Method Invoke

api/connection.go:89–104  ·  view source on GitHub ↗

Invoke implements [grpc.ClientConnInterface].

(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption)

Source from the content-addressed store, hash-verified

87
88// Invoke implements [grpc.ClientConnInterface].
89func (conn *RPCConnection[T]) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) (err error) {
90 // Make sure, this connection is established
91 err = conn.init()
92 if err != nil {
93 return
94 }
95
96 // Then, just forward the request to the embedded client conn
97 err = conn.cc.Invoke(ctx, method, args, reply, opts...)
98 if errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) {
99 log.Debugf("Caught EOF while invoking method %s, forcing connection to reconnect on next call", method)
100 conn.ForceReconnect()
101 }
102
103 return
104}
105
106// NewStream implements [grpc.ClientConnInterface].
107func (conn *RPCConnection[T]) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (stream grpc.ClientStream, err error) {

Callers 15

CalculateComplianceMethod · 0.80
AssessEvidenceMethod · 0.80
StartMethod · 0.80
ListResourcesMethod · 0.80
UpdateResourceMethod · 0.80
ListGraphEdgesMethod · 0.80
StoreEvidenceMethod · 0.80
ListEvidencesMethod · 0.80
GetEvidenceMethod · 0.80
StartEvaluationMethod · 0.80
StopEvaluationMethod · 0.80
ListEvaluationResultsMethod · 0.80

Calls 2

initMethod · 0.95
ForceReconnectMethod · 0.95

Tested by

no test coverage detected