evaluation

package
v2.0.0-ccit-pre2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultOrchestratorAddress specifies the default gRPC address of the orchestrator service.
	DefaultOrchestratorAddress = "localhost:9090"
)

Variables

View Source
var (
	ErrCatalogIdIsMissing    = errors.New("catalog_id is missing")
	ErrCategoryNameIsMissing = errors.New("category_name is missing")
	ErrControlIdIsMissing    = errors.New("control_id is missing")
	ErrControlNotAvailable   = errors.New("control not available")
)

Functions

func DefaultServiceSpec

func DefaultServiceSpec() launcher.ServiceSpec

DefaultServiceSpec returns a launcher.ServiceSpec for this Service with all necessary options retrieved from the config system.

func WithAuthorizer

func WithAuthorizer(auth api.Authorizer) service.Option[*Service]

WithAuthorizer is an option to use a pre-created authorizer

func WithOAuth2Authorizer

func WithOAuth2Authorizer(config *clientcredentials.Config) service.Option[*Service]

WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer

func WithOrchestratorAddress

func WithOrchestratorAddress(target string, opts ...grpc.DialOption) service.Option[*Service]

WithOrchestratorAddress is an option to configure the orchestrator service gRPC address.

func WithStorage

func WithStorage(storage persistence.Storage) service.Option[*Service]

WithStorage is an option to set the storage. If not set, NewService will use inmemory storage.

Types

type Service

type Service struct {
	evaluation.UnimplementedEvaluationServer
	// contains filtered or unexported fields
}

Service is an implementation of the Clouditor Evaluation service

func NewService

func NewService(opts ...service.Option[*Service]) *Service

NewService creates a new Evaluation service

func (*Service) CreateEvaluationResult

func (svc *Service) CreateEvaluationResult(ctx context.Context, req *evaluation.CreateEvaluationResultRequest) (res *evaluation.EvaluationResult, err error)

CreateEvaluationResult is a method implementation of the assessment interface

func (*Service) Init

func (svc *Service) Init()

func (*Service) ListEvaluationResults

ListEvaluationResults is a method implementation of the assessment interface

func (*Service) Shutdown

func (svc *Service) Shutdown()

func (*Service) StartEvaluation

func (svc *Service) StartEvaluation(ctx context.Context, req *evaluation.StartEvaluationRequest) (resp *evaluation.StartEvaluationResponse, err error)

StartEvaluation is a method implementation of the evaluation interface: It periodically starts the evaluation of a certification target and the given catalog in the audit_scope. If no interval time is given, the default value is used.

func (*Service) StopEvaluation

func (svc *Service) StopEvaluation(ctx context.Context, req *evaluation.StopEvaluationRequest) (resp *evaluation.StopEvaluationResponse, err error)

StopEvaluation is a method implementation of the evaluation interface: It stops the evaluation for a AuditScope.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL