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

Function WithServices

server/grpc.go:66–90  ·  view source on GitHub ↗

WithServices is an option for [StartGRPCServer] to register services at start.

(services ...service.Service)

Source from the content-addressed store, hash-verified

64
65// WithServices is an option for [StartGRPCServer] to register services at start.
66func WithServices(services ...service.Service) StartGRPCServerOption {
67 return func(c *config) {
68 for _, svc := range services {
69 if s, ok := svc.(orchestrator.OrchestratorServer); ok {
70 c.services[&orchestrator.Orchestrator_ServiceDesc] = s
71 }
72 if s, ok := svc.(assessment.AssessmentServer); ok {
73 c.services[&assessment.Assessment_ServiceDesc] = s
74 }
75 if s, ok := svc.(evidence.EvidenceStoreServer); ok {
76 c.services[&evidence.EvidenceStore_ServiceDesc] = s
77 }
78 if s, ok := svc.(discovery.DiscoveryServer); ok {
79 c.services[&discovery.Discovery_ServiceDesc] = s
80 }
81 if s, ok := svc.(discovery.ExperimentalDiscoveryServer); ok {
82 c.services[&discovery.ExperimentalDiscovery_ServiceDesc] = s
83 }
84 if s, ok := svc.(evaluation.EvaluationServer); ok {
85 c.services[&evaluation.Evaluation_ServiceDesc] = s
86 }
87 }
88
89 }
90}
91
92// WithReflection is an option for [StartGRPCServer] to enable gRPC reflection.
93func WithReflection() StartGRPCServerOption {

Callers 15

TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74