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

Method getControl

service/evaluation/evaluation.go:881–898  ·  view source on GitHub ↗

getControl returns the control for the given catalogID, CategoryName and controlID.

(catalogId, categoryName, controlId string)

Source from the content-addressed store, hash-verified

879
880// getControl returns the control for the given catalogID, CategoryName and controlID.
881func (svc *Service) getControl(catalogId, categoryName, controlId string) (control *orchestrator.Control, err error) {
882 if catalogId == "" {
883 return nil, ErrCatalogIdIsMissing
884 } else if categoryName == "" {
885 return nil, ErrCategoryNameIsMissing
886 } else if controlId == "" {
887 return nil, ErrControlIdIsMissing
888 }
889
890 tag := fmt.Sprintf("%s-%s", categoryName, controlId)
891
892 control, ok := svc.catalogControls[catalogId][tag]
893 if !ok {
894 return nil, ErrControlNotAvailable
895 }
896
897 return
898}
899
900// handlePending evaluates the given evaluation result when the current control evaluation status is PENDING
901func handlePending(er *evaluation.EvaluationResult) (evaluation.EvaluationStatus, []string) {

Callers 3

TestService_getControlFunction · 0.95

Implementers 5

Serviceservice/assessment/assessment.go
Serviceservice/discovery/discovery.go
Serviceservice/evidence/evidence_store.go
Serviceservice/evaluation/evaluation.go
Serviceservice/orchestrator/orchestrator.go

Calls

no outgoing calls

Tested by 1

TestService_getControlFunction · 0.76