Documentation ¶
Index ¶
- Constants
- type Service
- func (svc *Service) AssessEvidence(_ context.Context, req *assessment.AssessEvidenceRequest) (res *assessment.AssessEvidenceResponse, err error)
- func (svc *Service) AssessEvidences(stream assessment.Assessment_AssessEvidencesServer) (err error)
- func (svc *Service) Authorizer() api.Authorizer
- func (svc *Service) ListAssessmentResults(_ context.Context, req *assessment.ListAssessmentResultsRequest) (res *assessment.ListAssessmentResultsResponse, err error)
- func (svc *Service) MetricConfiguration(metric string) (config *assessment.MetricConfiguration, err error)
- func (svc *Service) MetricImplementation(lang assessment.MetricImplementation_Language, metric string) (impl *assessment.MetricImplementation, err error)
- func (svc *Service) Metrics() (metrics []*assessment.Metric, err error)
- func (svc *Service) RegisterAssessmentResultHook(assessmentResultsHook func(result *assessment.AssessmentResult, err error))
- func (svc *Service) SetAuthorizer(auth api.Authorizer)
- type ServiceOption
Constants ¶
const ( // DefaultEvidenceStoreAddress specifies the default gRPC address of the evidence store. DefaultEvidenceStoreAddress = "localhost:9090" // DefaultOrchestratorAddress specifies the default gRPC address of the orchestrator. DefaultOrchestratorAddress = "localhost:9090" )
const ( // EvictionTime is the time after which an entry in the metric configuration is invalid EvictionTime = time.Hour * 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { // Embedded for FWD compatibility assessment.UnimplementedAssessmentServer // contains filtered or unexported fields }
Service is an implementation of the Clouditor Assessment service. It should not be used directly, but rather the NewService constructor should be used. It implements the AssessmentServer interface.
func NewService ¶ added in v1.3.4
func NewService(opts ...ServiceOption) *Service
NewService creates a new assessment service with default values.
func (*Service) AssessEvidence ¶ added in v1.3.6
func (svc *Service) AssessEvidence(_ context.Context, req *assessment.AssessEvidenceRequest) (res *assessment.AssessEvidenceResponse, err error)
AssessEvidence is a method implementation of the assessment interface: It assesses a single evidence
func (*Service) AssessEvidences ¶ added in v1.3.6
func (svc *Service) AssessEvidences(stream assessment.Assessment_AssessEvidencesServer) (err error)
AssessEvidences is a method implementation of the assessment interface: It assesses multiple evidences (stream) and responds with a stream.
func (*Service) Authorizer ¶ added in v1.4.0
func (svc *Service) Authorizer() api.Authorizer
Authorizer implements UsesAuthorizer
func (*Service) ListAssessmentResults ¶ added in v1.3.5
func (svc *Service) ListAssessmentResults(_ context.Context, req *assessment.ListAssessmentResultsRequest) (res *assessment.ListAssessmentResultsResponse, err error)
ListAssessmentResults is a method implementation of the assessment interface
func (*Service) MetricConfiguration ¶ added in v1.4.0
func (svc *Service) MetricConfiguration(metric string) (config *assessment.MetricConfiguration, err error)
MetricConfiguration implements MetricsSource by getting the corresponding metric configuration for the default target cloud service
func (*Service) MetricImplementation ¶ added in v1.4.5
func (svc *Service) MetricImplementation(lang assessment.MetricImplementation_Language, metric string) (impl *assessment.MetricImplementation, err error)
MetricImplementation implements MetricsSource by retrieving the metric implementation from the orchestrator.
func (*Service) Metrics ¶ added in v1.4.5
func (svc *Service) Metrics() (metrics []*assessment.Metric, err error)
Metrics implements MetricsSource by retrieving the metric list from the orchestrator.
func (*Service) RegisterAssessmentResultHook ¶ added in v1.3.11
func (svc *Service) RegisterAssessmentResultHook(assessmentResultsHook func(result *assessment.AssessmentResult, err error))
func (*Service) SetAuthorizer ¶ added in v1.4.0
func (svc *Service) SetAuthorizer(auth api.Authorizer)
SetAuthorizer implements UsesAuthorizer
type ServiceOption ¶ added in v1.3.14
type ServiceOption func(*Service)
ServiceOption is a functional option type to configure the assessment service.
func WithEvidenceStoreAddress ¶ added in v1.3.14
func WithEvidenceStoreAddress(address string, opts ...grpc.DialOption) ServiceOption
WithEvidenceStoreAddress is an option to configure the evidence store gRPC address.
func WithOAuth2Authorizer ¶ added in v1.4.0
func WithOAuth2Authorizer(config *clientcredentials.Config) ServiceOption
WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer
func WithOrchestratorAddress ¶ added in v1.3.14
func WithOrchestratorAddress(address string, opts ...grpc.DialOption) ServiceOption
WithOrchestratorAddress is an option to configure the orchestrator gRPC address.