github.com/Axway/agent-sdk@v1.1.101/pkg/compliance/runtimeresults.go (about)

     1  package compliance
     2  
     3  import (
     4  	"github.com/Axway/agent-sdk/pkg/util/log"
     5  )
     6  
     7  type RuntimeResult struct {
     8  	APIServiceInstance string  `json:"apiServiceInstance"`
     9  	RiskScore          float64 `json:"riskScore"`
    10  }
    11  
    12  type RuntimeResults interface {
    13  	AddRuntimeResult(RuntimeResult)
    14  }
    15  
    16  type runtimeResults struct {
    17  	logger log.FieldLogger
    18  	items  map[string]RuntimeResult
    19  }
    20  
    21  func (r *runtimeResults) AddRuntimeResult(result RuntimeResult) {
    22  	if r.items == nil {
    23  		r.items = make(map[string]RuntimeResult)
    24  	}
    25  	r.items[result.APIServiceInstance] = result
    26  }