assessment

package
v1.4.10 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 26 Imported by: 3

Documentation

Overview

Package assessment is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdInvalidFormat                       = errors.New("assessment result id not in expected format (UUID) or missing")
	ErrEvidenceIdInvalidFormat               = errors.New("evidence id not in expected format (UUID) or missing")
	ErrTimestampMissing                      = errors.New("timestamp in assessment result is missing")
	ErrResourceIdMissing                     = errors.New("resource id in assessment result is missing")
	ErrMetricIdMissing                       = errors.New("metric id is missing")
	ErrMetricConfigurationMissing            = errors.New("metric configuration in assessment result is missing")
	ErrMetricConfigurationOperatorMissing    = errors.New("operator in metric data is missing")
	ErrMetricConfigurationTargetValueMissing = errors.New("target value in metric data is missing")
)
View Source
var (
	AssessEvidenceResponse_AssessmentStatus_name = map[int32]string{
		0: "ASSESSMENT_STATUS_UNSPECIFIED",
		1: "WAITING_FOR_RELATED",
		2: "ASSESSED",
		3: "FAILED",
	}
	AssessEvidenceResponse_AssessmentStatus_value = map[string]int32{
		"ASSESSMENT_STATUS_UNSPECIFIED": 0,
		"WAITING_FOR_RELATED":           1,
		"ASSESSED":                      2,
		"FAILED":                        3,
	}
)

Enum value maps for AssessEvidenceResponse_AssessmentStatus.

View Source
var (
	ErrMetricNameMissing = errors.New("metric name is missing")
	ErrMetricEmpty       = errors.New("metric is missing or empty")
	ErrUnsupportedType   = errors.New("unsupported type")
)
View Source
var (
	Metric_Scale_name = map[int32]string{
		0: "NOMINAL",
		1: "ORDINAL",
		2: "METRIC",
	}
	Metric_Scale_value = map[string]int32{
		"NOMINAL": 0,
		"ORDINAL": 1,
		"METRIC":  2,
	}
)

Enum value maps for Metric_Scale.

View Source
var (
	MetricImplementation_Language_name = map[int32]string{
		0: "LANGUAGE_UNSPECIFIED",
		1: "REGO",
	}
	MetricImplementation_Language_value = map[string]int32{
		"LANGUAGE_UNSPECIFIED": 0,
		"REGO":                 1,
	}
)

Enum value maps for MetricImplementation_Language.

View Source
var Assessment_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clouditor.Assessment",
	HandlerType: (*AssessmentServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TriggerAssessment",
			Handler:    _Assessment_TriggerAssessment_Handler,
		},
		{
			MethodName: "AssessEvidence",
			Handler:    _Assessment_AssessEvidence_Handler,
		},
		{
			MethodName: "ListAssessmentResults",
			Handler:    _Assessment_ListAssessmentResults_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AssessEvidences",
			Handler:       _Assessment_AssessEvidences_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "api/assessment/assessment.proto",
}

Assessment_ServiceDesc is the grpc.ServiceDesc for Assessment service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_assessment_assessment_proto protoreflect.FileDescriptor
View Source
var File_api_assessment_metric_proto protoreflect.FileDescriptor

Functions

func RegisterAssessmentHandler added in v1.3.6

func RegisterAssessmentHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error

RegisterAssessmentHandler registers the http handlers for service Assessment to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAssessmentHandlerClient added in v1.3.6

func RegisterAssessmentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AssessmentClient) error

RegisterAssessmentHandlerClient registers the http handlers for service Assessment to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AssessmentClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AssessmentClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AssessmentClient" to call the correct interceptors.

func RegisterAssessmentHandlerFromEndpoint added in v1.3.6

func RegisterAssessmentHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAssessmentHandlerFromEndpoint is same as RegisterAssessmentHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAssessmentHandlerServer added in v1.3.6

func RegisterAssessmentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AssessmentServer) error

RegisterAssessmentHandlerServer registers the http handlers for service Assessment to "mux". UnaryRPC :call AssessmentServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAssessmentHandlerFromEndpoint instead.

func RegisterAssessmentServer

func RegisterAssessmentServer(s grpc.ServiceRegistrar, srv AssessmentServer)

Types

type AllowedValues

type AllowedValues struct {
	Values []*structpb.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Defines a range

func (*AllowedValues) Descriptor deprecated

func (*AllowedValues) Descriptor() ([]byte, []int)

Deprecated: Use AllowedValues.ProtoReflect.Descriptor instead.

func (*AllowedValues) GetValues

func (x *AllowedValues) GetValues() []*structpb.Value

func (*AllowedValues) ProtoMessage

func (*AllowedValues) ProtoMessage()

func (*AllowedValues) ProtoReflect

func (x *AllowedValues) ProtoReflect() protoreflect.Message

func (*AllowedValues) Reset

func (x *AllowedValues) Reset()

func (*AllowedValues) String

func (x *AllowedValues) String() string

type AssessEvidenceRequest added in v1.3.6

type AssessEvidenceRequest struct {
	Evidence *evidence.Evidence `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"`
	// contains filtered or unexported fields
}

func (*AssessEvidenceRequest) Descriptor deprecated added in v1.3.6

func (*AssessEvidenceRequest) Descriptor() ([]byte, []int)

Deprecated: Use AssessEvidenceRequest.ProtoReflect.Descriptor instead.

func (*AssessEvidenceRequest) GetEvidence added in v1.3.6

func (x *AssessEvidenceRequest) GetEvidence() *evidence.Evidence

func (*AssessEvidenceRequest) ProtoMessage added in v1.3.6

func (*AssessEvidenceRequest) ProtoMessage()

func (*AssessEvidenceRequest) ProtoReflect added in v1.3.6

func (x *AssessEvidenceRequest) ProtoReflect() protoreflect.Message

func (*AssessEvidenceRequest) Reset added in v1.3.6

func (x *AssessEvidenceRequest) Reset()

func (*AssessEvidenceRequest) String added in v1.3.6

func (x *AssessEvidenceRequest) String() string

type AssessEvidenceResponse added in v1.3.6

type AssessEvidenceResponse struct {
	Status        AssessEvidenceResponse_AssessmentStatus `protobuf:"varint,1,opt,name=status,proto3,enum=clouditor.AssessEvidenceResponse_AssessmentStatus" json:"status,omitempty"`
	StatusMessage string                                  `protobuf:"bytes,2,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"`
	// contains filtered or unexported fields
}

func (*AssessEvidenceResponse) Descriptor deprecated added in v1.3.6

func (*AssessEvidenceResponse) Descriptor() ([]byte, []int)

Deprecated: Use AssessEvidenceResponse.ProtoReflect.Descriptor instead.

func (*AssessEvidenceResponse) GetStatus added in v1.3.6

func (*AssessEvidenceResponse) GetStatusMessage added in v1.4.0

func (x *AssessEvidenceResponse) GetStatusMessage() string

func (*AssessEvidenceResponse) ProtoMessage added in v1.3.6

func (*AssessEvidenceResponse) ProtoMessage()

func (*AssessEvidenceResponse) ProtoReflect added in v1.3.6

func (x *AssessEvidenceResponse) ProtoReflect() protoreflect.Message

func (*AssessEvidenceResponse) Reset added in v1.3.6

func (x *AssessEvidenceResponse) Reset()

func (*AssessEvidenceResponse) String added in v1.3.6

func (x *AssessEvidenceResponse) String() string

type AssessEvidenceResponse_AssessmentStatus added in v1.4.0

type AssessEvidenceResponse_AssessmentStatus int32
const (
	AssessEvidenceResponse_ASSESSMENT_STATUS_UNSPECIFIED AssessEvidenceResponse_AssessmentStatus = 0
	AssessEvidenceResponse_WAITING_FOR_RELATED           AssessEvidenceResponse_AssessmentStatus = 1
	AssessEvidenceResponse_ASSESSED                      AssessEvidenceResponse_AssessmentStatus = 2
	AssessEvidenceResponse_FAILED                        AssessEvidenceResponse_AssessmentStatus = 3
)

func (AssessEvidenceResponse_AssessmentStatus) Descriptor added in v1.4.0

func (AssessEvidenceResponse_AssessmentStatus) Enum added in v1.4.0

func (AssessEvidenceResponse_AssessmentStatus) EnumDescriptor deprecated added in v1.4.0

func (AssessEvidenceResponse_AssessmentStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use AssessEvidenceResponse_AssessmentStatus.Descriptor instead.

func (AssessEvidenceResponse_AssessmentStatus) Number added in v1.4.0

func (AssessEvidenceResponse_AssessmentStatus) String added in v1.4.0

func (AssessEvidenceResponse_AssessmentStatus) Type added in v1.4.0

type AssessmentClient

type AssessmentClient interface {
	// Triggers the assessment. Part of the private API. Not exposed as REST.
	TriggerAssessment(ctx context.Context, in *TriggerAssessmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Assesses the evidence sent by the discovery. Part of the public API, also
	// exposed as REST.
	AssessEvidence(ctx context.Context, in *AssessEvidenceRequest, opts ...grpc.CallOption) (*AssessEvidenceResponse, error)
	// Assesses stream of evidences sent by the discovery and returns a response
	// stream. Part of the public API. Not exposed as REST.
	AssessEvidences(ctx context.Context, opts ...grpc.CallOption) (Assessment_AssessEvidencesClient, error)
	// List all assessment results. Part of the public API, also exposed as REST.
	ListAssessmentResults(ctx context.Context, in *ListAssessmentResultsRequest, opts ...grpc.CallOption) (*ListAssessmentResultsResponse, error)
}

AssessmentClient is the client API for Assessment service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAssessmentClient

func NewAssessmentClient(cc grpc.ClientConnInterface) AssessmentClient

type AssessmentResult added in v1.3.11

type AssessmentResult struct {

	// Assessment result id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Time of assessment
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Reference to the metric the assessment was based on
	MetricId string `protobuf:"bytes,3,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// Data corresponding to the metric by the given metric id
	MetricConfiguration *MetricConfiguration `protobuf:"bytes,4,opt,name=metric_configuration,json=metricConfiguration,proto3" json:"metric_configuration,omitempty"`
	// Compliant case: true or false
	Compliant bool `protobuf:"varint,5,opt,name=compliant,proto3" json:"compliant,omitempty"`
	// Reference to the assessed evidence
	EvidenceId string `protobuf:"bytes,6,opt,name=evidence_id,json=evidenceId,proto3" json:"evidence_id,omitempty"`
	// Reference to the resource of the assessed evidence
	ResourceId string `protobuf:"bytes,7,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	// Some comments on the reason for non-compliance
	NonComplianceComments string `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

A result resource, representing the result after assessing the cloud resource with id resource_id.

func (*AssessmentResult) Descriptor deprecated added in v1.3.11

func (*AssessmentResult) Descriptor() ([]byte, []int)

Deprecated: Use AssessmentResult.ProtoReflect.Descriptor instead.

func (*AssessmentResult) GetCompliant added in v1.3.11

func (x *AssessmentResult) GetCompliant() bool

func (*AssessmentResult) GetEvidenceId added in v1.3.11

func (x *AssessmentResult) GetEvidenceId() string

func (*AssessmentResult) GetId added in v1.3.11

func (x *AssessmentResult) GetId() string

func (*AssessmentResult) GetMetricConfiguration added in v1.3.11

func (x *AssessmentResult) GetMetricConfiguration() *MetricConfiguration

func (*AssessmentResult) GetMetricId added in v1.3.11

func (x *AssessmentResult) GetMetricId() string

func (*AssessmentResult) GetNonComplianceComments added in v1.3.11

func (x *AssessmentResult) GetNonComplianceComments() string

func (*AssessmentResult) GetResourceId added in v1.3.11

func (x *AssessmentResult) GetResourceId() string

func (*AssessmentResult) GetTimestamp added in v1.3.11

func (x *AssessmentResult) GetTimestamp() *timestamppb.Timestamp

func (*AssessmentResult) ProtoMessage added in v1.3.11

func (*AssessmentResult) ProtoMessage()

func (*AssessmentResult) ProtoReflect added in v1.3.11

func (x *AssessmentResult) ProtoReflect() protoreflect.Message

func (*AssessmentResult) Reset added in v1.3.11

func (x *AssessmentResult) Reset()

func (*AssessmentResult) String added in v1.3.11

func (x *AssessmentResult) String() string

func (*AssessmentResult) Validate added in v1.3.11

func (result *AssessmentResult) Validate() (resourceId string, err error)

Validate validates the assessment result according to several required fields

type AssessmentServer

type AssessmentServer interface {
	// Triggers the assessment. Part of the private API. Not exposed as REST.
	TriggerAssessment(context.Context, *TriggerAssessmentRequest) (*emptypb.Empty, error)
	// Assesses the evidence sent by the discovery. Part of the public API, also
	// exposed as REST.
	AssessEvidence(context.Context, *AssessEvidenceRequest) (*AssessEvidenceResponse, error)
	// Assesses stream of evidences sent by the discovery and returns a response
	// stream. Part of the public API. Not exposed as REST.
	AssessEvidences(Assessment_AssessEvidencesServer) error
	// List all assessment results. Part of the public API, also exposed as REST.
	ListAssessmentResults(context.Context, *ListAssessmentResultsRequest) (*ListAssessmentResultsResponse, error)
	// contains filtered or unexported methods
}

AssessmentServer is the server API for Assessment service. All implementations must embed UnimplementedAssessmentServer for forward compatibility

type Assessment_AssessEvidencesClient added in v1.3.6

type Assessment_AssessEvidencesClient interface {
	Send(*AssessEvidenceRequest) error
	Recv() (*AssessEvidenceResponse, error)
	grpc.ClientStream
}

type Assessment_AssessEvidencesServer added in v1.3.6

type Assessment_AssessEvidencesServer interface {
	Send(*AssessEvidenceResponse) error
	Recv() (*AssessEvidenceRequest, error)
	grpc.ServerStream
}

type ConfigureAssessmentRequest added in v1.3.12

type ConfigureAssessmentRequest struct {
	// contains filtered or unexported fields
}

func (*ConfigureAssessmentRequest) Descriptor deprecated added in v1.3.12

func (*ConfigureAssessmentRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfigureAssessmentRequest.ProtoReflect.Descriptor instead.

func (*ConfigureAssessmentRequest) ProtoMessage added in v1.3.12

func (*ConfigureAssessmentRequest) ProtoMessage()

func (*ConfigureAssessmentRequest) ProtoReflect added in v1.3.12

func (*ConfigureAssessmentRequest) Reset added in v1.3.12

func (x *ConfigureAssessmentRequest) Reset()

func (*ConfigureAssessmentRequest) String added in v1.3.12

func (x *ConfigureAssessmentRequest) String() string

type ConfigureAssessmentResponse added in v1.3.12

type ConfigureAssessmentResponse struct {
	// contains filtered or unexported fields
}

func (*ConfigureAssessmentResponse) Descriptor deprecated added in v1.3.12

func (*ConfigureAssessmentResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConfigureAssessmentResponse.ProtoReflect.Descriptor instead.

func (*ConfigureAssessmentResponse) ProtoMessage added in v1.3.12

func (*ConfigureAssessmentResponse) ProtoMessage()

func (*ConfigureAssessmentResponse) ProtoReflect added in v1.3.12

func (*ConfigureAssessmentResponse) Reset added in v1.3.12

func (x *ConfigureAssessmentResponse) Reset()

func (*ConfigureAssessmentResponse) String added in v1.3.12

func (x *ConfigureAssessmentResponse) String() string

type ListAssessmentResultsRequest added in v1.3.5

type ListAssessmentResultsRequest struct {
	PageSize  int32  `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssessmentResultsRequest) Descriptor deprecated added in v1.3.5

func (*ListAssessmentResultsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListAssessmentResultsRequest.ProtoReflect.Descriptor instead.

func (*ListAssessmentResultsRequest) GetPageSize added in v1.4.6

func (x *ListAssessmentResultsRequest) GetPageSize() int32

func (*ListAssessmentResultsRequest) GetPageToken added in v1.4.6

func (x *ListAssessmentResultsRequest) GetPageToken() string

func (*ListAssessmentResultsRequest) ProtoMessage added in v1.3.5

func (*ListAssessmentResultsRequest) ProtoMessage()

func (*ListAssessmentResultsRequest) ProtoReflect added in v1.3.5

func (*ListAssessmentResultsRequest) Reset added in v1.3.5

func (x *ListAssessmentResultsRequest) Reset()

func (*ListAssessmentResultsRequest) String added in v1.3.5

type ListAssessmentResultsResponse added in v1.3.5

type ListAssessmentResultsResponse struct {
	Results       []*AssessmentResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	NextPageToken string              `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssessmentResultsResponse) Descriptor deprecated added in v1.3.5

func (*ListAssessmentResultsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListAssessmentResultsResponse.ProtoReflect.Descriptor instead.

func (*ListAssessmentResultsResponse) GetNextPageToken added in v1.4.6

func (x *ListAssessmentResultsResponse) GetNextPageToken() string

func (*ListAssessmentResultsResponse) GetResults added in v1.3.5

func (*ListAssessmentResultsResponse) ProtoMessage added in v1.3.5

func (*ListAssessmentResultsResponse) ProtoMessage()

func (*ListAssessmentResultsResponse) ProtoReflect added in v1.3.5

func (*ListAssessmentResultsResponse) Reset added in v1.3.5

func (x *ListAssessmentResultsResponse) Reset()

func (*ListAssessmentResultsResponse) String added in v1.3.5

type Metric

type Metric struct {

	// Required. The unique identifier of the metric.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Required. The human readable name of the metric.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The description of the metric
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// The reference to control catalog category or domain
	Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
	// The scale of this metric, e.g. categories, ranked data or metric values.
	Scale Metric_Scale `protobuf:"varint,5,opt,name=scale,proto3,enum=clouditor.Metric_Scale" json:"scale,omitempty"`
	// The range of this metric. Depending on the scale.
	Range *Range `protobuf:"bytes,6,opt,name=range,proto3" json:"range,omitempty"`
	// contains filtered or unexported fields
}

A metric resource

func (*Metric) Descriptor deprecated

func (*Metric) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetCategory

func (x *Metric) GetCategory() string

func (*Metric) GetDescription

func (x *Metric) GetDescription() string

func (*Metric) GetId

func (x *Metric) GetId() string

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) GetRange

func (x *Metric) GetRange() *Range

func (*Metric) GetScale

func (x *Metric) GetScale() Metric_Scale

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

func (*Metric) Validate added in v1.3.14

func (m *Metric) Validate(opts ...MetricValidationOption) (err error)

Validate validates the metric according to several required fields.

type MetricConfiguration added in v1.3.11

type MetricConfiguration struct {

	// The operator to compare the metric, such as == or >
	Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"`
	// The target value
	TargetValue *structpb.Value `protobuf:"bytes,2,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty"`
	// Whether this configuration is a default configuration
	IsDefault bool `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"`
	// contains filtered or unexported fields
}

Defines the operator and a target value for an individual metric

func (*MetricConfiguration) Descriptor deprecated added in v1.3.11

func (*MetricConfiguration) Descriptor() ([]byte, []int)

Deprecated: Use MetricConfiguration.ProtoReflect.Descriptor instead.

func (*MetricConfiguration) GetIsDefault added in v1.3.11

func (x *MetricConfiguration) GetIsDefault() bool

func (*MetricConfiguration) GetOperator added in v1.3.11

func (x *MetricConfiguration) GetOperator() string

func (*MetricConfiguration) GetTargetValue added in v1.3.11

func (x *MetricConfiguration) GetTargetValue() *structpb.Value

func (*MetricConfiguration) Hash added in v1.4.1

func (x *MetricConfiguration) Hash() string

Hash provides a simple string based hash for this metric configuration. It can be used to provide a key for a map or a cache.

func (*MetricConfiguration) ProtoMessage added in v1.3.11

func (*MetricConfiguration) ProtoMessage()

func (*MetricConfiguration) ProtoReflect added in v1.3.11

func (x *MetricConfiguration) ProtoReflect() protoreflect.Message

func (*MetricConfiguration) Reset added in v1.3.11

func (x *MetricConfiguration) Reset()

func (*MetricConfiguration) String added in v1.3.11

func (x *MetricConfiguration) String() string

type MetricImplementation added in v1.4.0

type MetricImplementation struct {

	// The metric which is implemented
	MetricId string `protobuf:"bytes,1,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// The language this metric is implemented in
	Lang MetricImplementation_Language `protobuf:"varint,2,opt,name=lang,proto3,enum=clouditor.MetricImplementation_Language" json:"lang,omitempty"`
	// The actual implementation
	Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

MetricImplementation defines the implementation of an individual metric.

func (*MetricImplementation) Descriptor deprecated added in v1.4.0

func (*MetricImplementation) Descriptor() ([]byte, []int)

Deprecated: Use MetricImplementation.ProtoReflect.Descriptor instead.

func (*MetricImplementation) GetCode added in v1.4.0

func (x *MetricImplementation) GetCode() string

func (*MetricImplementation) GetLang added in v1.4.5

func (*MetricImplementation) GetMetricId added in v1.4.5

func (x *MetricImplementation) GetMetricId() string

func (*MetricImplementation) ProtoMessage added in v1.4.0

func (*MetricImplementation) ProtoMessage()

func (*MetricImplementation) ProtoReflect added in v1.4.0

func (x *MetricImplementation) ProtoReflect() protoreflect.Message

func (*MetricImplementation) Reset added in v1.4.0

func (x *MetricImplementation) Reset()

func (*MetricImplementation) String added in v1.4.0

func (x *MetricImplementation) String() string

type MetricImplementation_Language added in v1.4.0

type MetricImplementation_Language int32
const (
	MetricImplementation_LANGUAGE_UNSPECIFIED MetricImplementation_Language = 0
	MetricImplementation_REGO                 MetricImplementation_Language = 1
)

func (MetricImplementation_Language) Descriptor added in v1.4.0

func (MetricImplementation_Language) Enum added in v1.4.0

func (MetricImplementation_Language) EnumDescriptor deprecated added in v1.4.0

func (MetricImplementation_Language) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetricImplementation_Language.Descriptor instead.

func (MetricImplementation_Language) Number added in v1.4.0

func (MetricImplementation_Language) String added in v1.4.0

func (MetricImplementation_Language) Type added in v1.4.0

type MetricValidationOption added in v1.3.14

type MetricValidationOption func(*Metric) error

MetricValidationOption is a function-style option to fine-tune metric validation.

func WithMetricRequiresId added in v1.3.14

func WithMetricRequiresId() MetricValidationOption

WithMetricRequiresId is a validation option that specifies that Id must not be empty.

type Metric_Scale

type Metric_Scale int32

The values a Scale accepts

const (
	Metric_NOMINAL Metric_Scale = 0
	Metric_ORDINAL Metric_Scale = 1
	Metric_METRIC  Metric_Scale = 2
)

func (Metric_Scale) Descriptor

func (Metric_Scale) Enum

func (x Metric_Scale) Enum() *Metric_Scale

func (Metric_Scale) EnumDescriptor deprecated

func (Metric_Scale) EnumDescriptor() ([]byte, []int)

Deprecated: Use Metric_Scale.Descriptor instead.

func (Metric_Scale) Number

func (Metric_Scale) String

func (x Metric_Scale) String() string

func (Metric_Scale) Type

type MinMax

type MinMax struct {

	// Required.
	Min int64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// Required.
	Max int64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// contains filtered or unexported fields
}

Defines a range of values through a (inclusive) minimum and a maximum

func (*MinMax) Descriptor deprecated

func (*MinMax) Descriptor() ([]byte, []int)

Deprecated: Use MinMax.ProtoReflect.Descriptor instead.

func (*MinMax) GetMax

func (x *MinMax) GetMax() int64

func (*MinMax) GetMin

func (x *MinMax) GetMin() int64

func (*MinMax) ProtoMessage

func (*MinMax) ProtoMessage()

func (*MinMax) ProtoReflect

func (x *MinMax) ProtoReflect() protoreflect.Message

func (*MinMax) Reset

func (x *MinMax) Reset()

func (*MinMax) String

func (x *MinMax) String() string

type Order

type Order struct {
	Values []*structpb.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Defines a range of values in a pre-defined order from the lowest to the highest.

func (*Order) Descriptor deprecated

func (*Order) Descriptor() ([]byte, []int)

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetValues

func (x *Order) GetValues() []*structpb.Value

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

func (x *Order) ProtoReflect() protoreflect.Message

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type Range

type Range struct {

	// Required.
	//
	// Types that are assignable to Range:
	//	*Range_AllowedValues
	//	*Range_Order
	//	*Range_MinMax
	Range isRange_Range `protobuf_oneof:"range"`
	// contains filtered or unexported fields
}

A range resource representing the range of values

func (*Range) Descriptor deprecated

func (*Range) Descriptor() ([]byte, []int)

Deprecated: Use Range.ProtoReflect.Descriptor instead.

func (*Range) GetAllowedValues

func (x *Range) GetAllowedValues() *AllowedValues

func (*Range) GetMinMax

func (x *Range) GetMinMax() *MinMax

func (*Range) GetOrder

func (x *Range) GetOrder() *Order

func (*Range) GetRange

func (m *Range) GetRange() isRange_Range

func (*Range) GormDataType added in v1.4.10

func (r *Range) GormDataType() string

GormDataType implements GormDataTypeInterface to give an indication how this struct will be serialized into a database using GORM.

func (*Range) MarshalJSON added in v1.4.10

func (r *Range) MarshalJSON() (b []byte, err error)

MarshalJSON is a custom implementation of JSON marshalling to correctly serialize the Range type because the inner types, such as Range_AllowedValues are missing json struct tags. This is needed if the Range type is marshalled on its own (for example) as a single field in a database. In gRPC messages, the protojson.Marshal function takes care of this.

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) ProtoReflect

func (x *Range) ProtoReflect() protoreflect.Message

func (*Range) Reset

func (x *Range) Reset()

func (*Range) Scan added in v1.4.10

func (r *Range) Scan(value interface{}) (err error)

Scan implements https://pkg.go.dev/database/sql#Scanner to indicate how this struct can be loaded from an SQL database field.

func (*Range) String

func (x *Range) String() string

func (*Range) UnmarshalJSON added in v1.3.5

func (r *Range) UnmarshalJSON(b []byte) (err error)

func (*Range) Value added in v1.4.10

func (r *Range) Value() (val driver.Value, err error)

Value implements https://pkg.go.dev/database/sql/driver#Valuer to indicate how this struct will be saved into an SQL database field.

type Range_AllowedValues

type Range_AllowedValues struct {
	// used for nominal scale
	AllowedValues *AllowedValues `protobuf:"bytes,1,opt,name=allowed_values,json=allowedValues,proto3,oneof"`
}

type Range_MinMax

type Range_MinMax struct {
	// used for metric scale
	MinMax *MinMax `protobuf:"bytes,3,opt,name=min_max,json=minMax,proto3,oneof"`
}

type Range_Order

type Range_Order struct {
	// used for ordinal scale
	Order *Order `protobuf:"bytes,2,opt,name=order,proto3,oneof"`
}

type ResultHookFunc added in v1.3.11

type ResultHookFunc func(result *AssessmentResult, err error)

type TriggerAssessmentRequest

type TriggerAssessmentRequest struct {
	SomeOption string `protobuf:"bytes,1,opt,name=some_option,json=someOption,proto3" json:"some_option,omitempty"`
	// contains filtered or unexported fields
}

func (*TriggerAssessmentRequest) Descriptor deprecated

func (*TriggerAssessmentRequest) Descriptor() ([]byte, []int)

Deprecated: Use TriggerAssessmentRequest.ProtoReflect.Descriptor instead.

func (*TriggerAssessmentRequest) GetSomeOption

func (x *TriggerAssessmentRequest) GetSomeOption() string

func (*TriggerAssessmentRequest) ProtoMessage

func (*TriggerAssessmentRequest) ProtoMessage()

func (*TriggerAssessmentRequest) ProtoReflect

func (x *TriggerAssessmentRequest) ProtoReflect() protoreflect.Message

func (*TriggerAssessmentRequest) Reset

func (x *TriggerAssessmentRequest) Reset()

func (*TriggerAssessmentRequest) String

func (x *TriggerAssessmentRequest) String() string

type UnimplementedAssessmentServer

type UnimplementedAssessmentServer struct {
}

UnimplementedAssessmentServer must be embedded to have forward compatible implementations.

func (UnimplementedAssessmentServer) AssessEvidence added in v1.3.6

func (UnimplementedAssessmentServer) AssessEvidences added in v1.3.6

func (UnimplementedAssessmentServer) ListAssessmentResults added in v1.3.5

func (UnimplementedAssessmentServer) TriggerAssessment

type UnsafeAssessmentServer

type UnsafeAssessmentServer interface {
	// contains filtered or unexported methods
}

UnsafeAssessmentServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AssessmentServer will result in compilation errors.

Jump to

Keyboard shortcuts

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