evaluation

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package evaluation is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Evaluation_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cam.Evaluation",
	HandlerType: (*EvaluationServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetEvidence",
			Handler:    _Evaluation_GetEvidence_Handler,
		},
		{
			MethodName: "ListEvidences",
			Handler:    _Evaluation_ListEvidences_Handler,
		},
		{
			MethodName: "GetEvaluation",
			Handler:    _Evaluation_GetEvaluation_Handler,
		},
		{
			MethodName: "CalculateCompliance",
			Handler:    _Evaluation_CalculateCompliance_Handler,
		},
		{
			MethodName: "GetCompliance",
			Handler:    _Evaluation_GetCompliance_Handler,
		},
		{
			MethodName: "ListCompliance",
			Handler:    _Evaluation_ListCompliance_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SendEvidences",
			Handler:       _Evaluation_SendEvidences_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "StreamEvaluations",
			Handler:       _Evaluation_StreamEvaluations_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/evaluation/evaluation.proto",
}

Evaluation_ServiceDesc is the grpc.ServiceDesc for Evaluation 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_evaluation_evaluation_proto protoreflect.FileDescriptor

Functions

func RegisterEvaluationHandler

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

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

func RegisterEvaluationHandlerClient

func RegisterEvaluationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EvaluationClient) error

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

func RegisterEvaluationHandlerFromEndpoint

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

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

func RegisterEvaluationHandlerServer

func RegisterEvaluationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EvaluationServer) error

RegisterEvaluationHandlerServer registers the http handlers for service Evaluation to "mux". UnaryRPC :call EvaluationServer 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 RegisterEvaluationHandlerFromEndpoint instead.

func RegisterEvaluationServer

func RegisterEvaluationServer(s grpc.ServiceRegistrar, srv EvaluationServer)

Types

type CalculateComplianceRequest added in v0.2.0

type CalculateComplianceRequest struct {
	ServiceId  string   `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	ControlIds []string `protobuf:"bytes,2,rep,name=control_ids,json=controlIds,proto3" json:"control_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*CalculateComplianceRequest) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CalculateComplianceRequest.ProtoReflect.Descriptor instead.

func (*CalculateComplianceRequest) GetControlIds added in v0.2.0

func (x *CalculateComplianceRequest) GetControlIds() []string

func (*CalculateComplianceRequest) GetServiceId added in v0.2.0

func (x *CalculateComplianceRequest) GetServiceId() string

func (*CalculateComplianceRequest) ProtoMessage added in v0.2.0

func (*CalculateComplianceRequest) ProtoMessage()

func (*CalculateComplianceRequest) ProtoReflect added in v0.2.0

func (*CalculateComplianceRequest) Reset added in v0.2.0

func (x *CalculateComplianceRequest) Reset()

func (*CalculateComplianceRequest) String added in v0.2.0

func (x *CalculateComplianceRequest) String() string

type Compliance

type Compliance struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Reference to the service to check for compliance
	ServiceId string `protobuf:"bytes,6,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// Reference to the control to check for compliance
	ControlId string `protobuf:"bytes,2,opt,name=control_id,json=controlId,proto3" json:"control_id,omitempty"`
	// List of references to evaluations of metrics which are associated to this
	// control
	Evaluations []*EvaluationResult `protobuf:"bytes,3,rep,name=evaluations,proto3" json:"evaluations,omitempty" gorm:"many2many:compliance_evaluations"`
	// Compliant case: True or false
	Status bool `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"`
	// Time of check for compliance
	Time *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=time,proto3" json:"time,omitempty" gorm:"serializer:timestamppb;type:time"`
	// contains filtered or unexported fields
}

func (*Compliance) Descriptor deprecated

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

Deprecated: Use Compliance.ProtoReflect.Descriptor instead.

func (*Compliance) GetControlId

func (x *Compliance) GetControlId() string

func (*Compliance) GetEvaluations

func (x *Compliance) GetEvaluations() []*EvaluationResult

func (*Compliance) GetId

func (x *Compliance) GetId() string

func (*Compliance) GetServiceId added in v0.2.0

func (x *Compliance) GetServiceId() string

func (*Compliance) GetStatus

func (x *Compliance) GetStatus() bool

func (*Compliance) GetTime

func (x *Compliance) GetTime() *timestamppb.Timestamp

func (*Compliance) ProtoMessage

func (*Compliance) ProtoMessage()

func (*Compliance) ProtoReflect

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

func (*Compliance) Reset

func (x *Compliance) Reset()

func (*Compliance) String

func (x *Compliance) String() string

type EvaluationClient

type EvaluationClient interface {
	SendEvidences(ctx context.Context, opts ...grpc.CallOption) (Evaluation_SendEvidencesClient, error)
	GetEvidence(ctx context.Context, in *GetEvidenceRequest, opts ...grpc.CallOption) (*common.Evidence, error)
	ListEvidences(ctx context.Context, in *ListEvidencesRequest, opts ...grpc.CallOption) (*ListEvidencesResponse, error)
	GetEvaluation(ctx context.Context, in *GetEvaluationRequest, opts ...grpc.CallOption) (*EvaluationResult, error)
	StreamEvaluations(ctx context.Context, in *StreamEvaluationsRequest, opts ...grpc.CallOption) (Evaluation_StreamEvaluationsClient, error)
	CalculateCompliance(ctx context.Context, in *CalculateComplianceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetCompliance(ctx context.Context, in *GetComplianceRequest, opts ...grpc.CallOption) (*Compliance, error)
	ListCompliance(ctx context.Context, in *ListComplianceRequest, opts ...grpc.CallOption) (*ListComplianceResponse, error)
}

EvaluationClient is the client API for Evaluation 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 NewEvaluationClient

func NewEvaluationClient(cc grpc.ClientConnInterface) EvaluationClient

type EvaluationResult

type EvaluationResult struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Reference to the service that was the target of evaluation
	ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// Reference to the metric that was used for evaluation
	MetricId string `protobuf:"bytes,3,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// Reference to the evidence that was evaluated
	EvidenceId string `protobuf:"bytes,4,opt,name=evidence_id,json=evidenceId,proto3" json:"evidence_id,omitempty"`
	// True, if evaluation was successful. Otherwise false
	Status bool `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
	// Time of evaluation
	Time *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=time,proto3" json:"time,omitempty" gorm:"serializer:timestamppb;type:time"`
	// contains filtered or unexported fields
}

func (*EvaluationResult) Descriptor deprecated

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

Deprecated: Use EvaluationResult.ProtoReflect.Descriptor instead.

func (*EvaluationResult) GetEvidenceId

func (x *EvaluationResult) GetEvidenceId() string

func (*EvaluationResult) GetId

func (x *EvaluationResult) GetId() string

func (*EvaluationResult) GetMetricId

func (x *EvaluationResult) GetMetricId() string

func (*EvaluationResult) GetServiceId

func (x *EvaluationResult) GetServiceId() string

func (*EvaluationResult) GetStatus

func (x *EvaluationResult) GetStatus() bool

func (*EvaluationResult) GetTime

func (x *EvaluationResult) GetTime() *timestamppb.Timestamp

func (*EvaluationResult) ProtoMessage

func (*EvaluationResult) ProtoMessage()

func (*EvaluationResult) ProtoReflect

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

func (*EvaluationResult) Reset

func (x *EvaluationResult) Reset()

func (*EvaluationResult) String

func (x *EvaluationResult) String() string

type EvaluationServer

EvaluationServer is the server API for Evaluation service. All implementations must embed UnimplementedEvaluationServer for forward compatibility

type Evaluation_SendEvidencesClient

type Evaluation_SendEvidencesClient interface {
	Send(*common.Evidence) error
	CloseAndRecv() (*emptypb.Empty, error)
	grpc.ClientStream
}

type Evaluation_SendEvidencesServer

type Evaluation_SendEvidencesServer interface {
	SendAndClose(*emptypb.Empty) error
	Recv() (*common.Evidence, error)
	grpc.ServerStream
}

type Evaluation_StreamEvaluationsClient

type Evaluation_StreamEvaluationsClient interface {
	Recv() (*EvaluationResult, error)
	grpc.ClientStream
}

type Evaluation_StreamEvaluationsServer

type Evaluation_StreamEvaluationsServer interface {
	Send(*EvaluationResult) error
	grpc.ServerStream
}

type GetComplianceRequest

type GetComplianceRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	ControlId string `protobuf:"bytes,2,opt,name=control_id,json=controlId,proto3" json:"control_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetComplianceRequest) Descriptor deprecated

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

Deprecated: Use GetComplianceRequest.ProtoReflect.Descriptor instead.

func (*GetComplianceRequest) GetControlId

func (x *GetComplianceRequest) GetControlId() string

func (*GetComplianceRequest) GetServiceId

func (x *GetComplianceRequest) GetServiceId() string

func (*GetComplianceRequest) ProtoMessage

func (*GetComplianceRequest) ProtoMessage()

func (*GetComplianceRequest) ProtoReflect

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

func (*GetComplianceRequest) Reset

func (x *GetComplianceRequest) Reset()

func (*GetComplianceRequest) String

func (x *GetComplianceRequest) String() string

type GetEvaluationRequest

type GetEvaluationRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	MetricId  string `protobuf:"bytes,2,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEvaluationRequest) Descriptor deprecated

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

Deprecated: Use GetEvaluationRequest.ProtoReflect.Descriptor instead.

func (*GetEvaluationRequest) GetMetricId

func (x *GetEvaluationRequest) GetMetricId() string

func (*GetEvaluationRequest) GetServiceId

func (x *GetEvaluationRequest) GetServiceId() string

func (*GetEvaluationRequest) ProtoMessage

func (*GetEvaluationRequest) ProtoMessage()

func (*GetEvaluationRequest) ProtoReflect

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

func (*GetEvaluationRequest) Reset

func (x *GetEvaluationRequest) Reset()

func (*GetEvaluationRequest) String

func (x *GetEvaluationRequest) String() string

type GetEvidenceRequest

type GetEvidenceRequest struct {
	EvidenceId string `protobuf:"bytes,1,opt,name=evidence_id,json=evidenceId,proto3" json:"evidence_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetEvidenceRequest) Descriptor deprecated

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

Deprecated: Use GetEvidenceRequest.ProtoReflect.Descriptor instead.

func (*GetEvidenceRequest) GetEvidenceId

func (x *GetEvidenceRequest) GetEvidenceId() string

func (*GetEvidenceRequest) ProtoMessage

func (*GetEvidenceRequest) ProtoMessage()

func (*GetEvidenceRequest) ProtoReflect

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

func (*GetEvidenceRequest) Reset

func (x *GetEvidenceRequest) Reset()

func (*GetEvidenceRequest) String

func (x *GetEvidenceRequest) String() string

type ListComplianceRequest

type ListComplianceRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// Optional. Determines the period of time of compliances
	Days      int64  `protobuf:"varint,2,opt,name=days,proto3" json:"days,omitempty"`
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32  `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	OrderBy   string `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	Asc       bool   `protobuf:"varint,6,opt,name=asc,proto3" json:"asc,omitempty"`
	// contains filtered or unexported fields
}

func (*ListComplianceRequest) Descriptor deprecated

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

Deprecated: Use ListComplianceRequest.ProtoReflect.Descriptor instead.

func (*ListComplianceRequest) GetAsc

func (x *ListComplianceRequest) GetAsc() bool

func (*ListComplianceRequest) GetDays

func (x *ListComplianceRequest) GetDays() int64

func (*ListComplianceRequest) GetOrderBy

func (x *ListComplianceRequest) GetOrderBy() string

func (*ListComplianceRequest) GetPageSize

func (x *ListComplianceRequest) GetPageSize() int32

func (*ListComplianceRequest) GetPageToken

func (x *ListComplianceRequest) GetPageToken() string

func (*ListComplianceRequest) GetServiceId

func (x *ListComplianceRequest) GetServiceId() string

func (*ListComplianceRequest) ProtoMessage

func (*ListComplianceRequest) ProtoMessage()

func (*ListComplianceRequest) ProtoReflect

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

func (*ListComplianceRequest) Reset

func (x *ListComplianceRequest) Reset()

func (*ListComplianceRequest) String

func (x *ListComplianceRequest) String() string

type ListComplianceResponse

type ListComplianceResponse struct {
	ComplianceResults []*Compliance `protobuf:"bytes,1,rep,name=compliance_results,json=complianceResults,proto3" json:"compliance_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 (*ListComplianceResponse) Descriptor deprecated

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

Deprecated: Use ListComplianceResponse.ProtoReflect.Descriptor instead.

func (*ListComplianceResponse) GetComplianceResults

func (x *ListComplianceResponse) GetComplianceResults() []*Compliance

func (*ListComplianceResponse) GetNextPageToken

func (x *ListComplianceResponse) GetNextPageToken() string

func (*ListComplianceResponse) ProtoMessage

func (*ListComplianceResponse) ProtoMessage()

func (*ListComplianceResponse) ProtoReflect

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

func (*ListComplianceResponse) Reset

func (x *ListComplianceResponse) Reset()

func (*ListComplianceResponse) String

func (x *ListComplianceResponse) String() string

type ListEvidencesRequest

type ListEvidencesRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// Optional. Determines the period of time of compliances
	Days      int64  `protobuf:"varint,2,opt,name=days,proto3" json:"days,omitempty"`
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32  `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	OrderBy   string `protobuf:"bytes,5,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
	Asc       bool   `protobuf:"varint,6,opt,name=asc,proto3" json:"asc,omitempty"`
	// contains filtered or unexported fields
}

func (*ListEvidencesRequest) Descriptor deprecated

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

Deprecated: Use ListEvidencesRequest.ProtoReflect.Descriptor instead.

func (*ListEvidencesRequest) GetAsc

func (x *ListEvidencesRequest) GetAsc() bool

func (*ListEvidencesRequest) GetDays

func (x *ListEvidencesRequest) GetDays() int64

func (*ListEvidencesRequest) GetOrderBy

func (x *ListEvidencesRequest) GetOrderBy() string

func (*ListEvidencesRequest) GetPageSize

func (x *ListEvidencesRequest) GetPageSize() int32

func (*ListEvidencesRequest) GetPageToken

func (x *ListEvidencesRequest) GetPageToken() string

func (*ListEvidencesRequest) GetServiceId

func (x *ListEvidencesRequest) GetServiceId() string

func (*ListEvidencesRequest) ProtoMessage

func (*ListEvidencesRequest) ProtoMessage()

func (*ListEvidencesRequest) ProtoReflect

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

func (*ListEvidencesRequest) Reset

func (x *ListEvidencesRequest) Reset()

func (*ListEvidencesRequest) String

func (x *ListEvidencesRequest) String() string

type ListEvidencesResponse

type ListEvidencesResponse struct {
	Evidences     []*common.Evidence `protobuf:"bytes,1,rep,name=evidences,proto3" json:"evidences,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 (*ListEvidencesResponse) Descriptor deprecated

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

Deprecated: Use ListEvidencesResponse.ProtoReflect.Descriptor instead.

func (*ListEvidencesResponse) GetEvidences

func (x *ListEvidencesResponse) GetEvidences() []*common.Evidence

func (*ListEvidencesResponse) GetNextPageToken

func (x *ListEvidencesResponse) GetNextPageToken() string

func (*ListEvidencesResponse) ProtoMessage

func (*ListEvidencesResponse) ProtoMessage()

func (*ListEvidencesResponse) ProtoReflect

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

func (*ListEvidencesResponse) Reset

func (x *ListEvidencesResponse) Reset()

func (*ListEvidencesResponse) String

func (x *ListEvidencesResponse) String() string

type StreamEvaluationsRequest

type StreamEvaluationsRequest struct {
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamEvaluationsRequest) Descriptor deprecated

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

Deprecated: Use StreamEvaluationsRequest.ProtoReflect.Descriptor instead.

func (*StreamEvaluationsRequest) GetServiceId

func (x *StreamEvaluationsRequest) GetServiceId() string

func (*StreamEvaluationsRequest) ProtoMessage

func (*StreamEvaluationsRequest) ProtoMessage()

func (*StreamEvaluationsRequest) ProtoReflect

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

func (*StreamEvaluationsRequest) Reset

func (x *StreamEvaluationsRequest) Reset()

func (*StreamEvaluationsRequest) String

func (x *StreamEvaluationsRequest) String() string

type UnimplementedEvaluationServer

type UnimplementedEvaluationServer struct {
}

UnimplementedEvaluationServer must be embedded to have forward compatible implementations.

func (UnimplementedEvaluationServer) CalculateCompliance added in v0.2.0

func (UnimplementedEvaluationServer) GetCompliance

func (UnimplementedEvaluationServer) GetEvaluation

func (UnimplementedEvaluationServer) GetEvidence

func (UnimplementedEvaluationServer) ListCompliance

func (UnimplementedEvaluationServer) ListEvidences

func (UnimplementedEvaluationServer) SendEvidences

type UnsafeEvaluationServer

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

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

Jump to

Keyboard shortcuts

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