getControl returns the control for the given catalogID, CategoryName and controlID.
(catalogId, categoryName, controlId string)
| 879 | |
| 880 | // getControl returns the control for the given catalogID, CategoryName and controlID. |
| 881 | func (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 |
| 901 | func handlePending(er *evaluation.EvaluationResult) (evaluation.EvaluationStatus, []string) { |
no outgoing calls