Documentation ¶
Index ¶
- Variables
- type Error
- type Error_Code
- type Evidence
- func (*Evidence) Descriptor() ([]byte, []int)deprecated
- func (x *Evidence) GetError() *Error
- func (x *Evidence) GetGatheredAt() *timestamppb.Timestamp
- func (x *Evidence) GetGatheredUsing() string
- func (x *Evidence) GetId() string
- func (x *Evidence) GetName() string
- func (x *Evidence) GetRawEvidence() string
- func (x *Evidence) GetTargetResource() string
- func (x *Evidence) GetTargetService() string
- func (x *Evidence) GetToolId() string
- func (x *Evidence) GetValue() *structpb.Value
- func (*Evidence) ProtoMessage()
- func (x *Evidence) ProtoReflect() protoreflect.Message
- func (x *Evidence) Reset()
- func (evidence *Evidence) ResourceTypes() (types []string, err error)
- func (x *Evidence) String() string
- func (e *Evidence) Validate() error
- type Metric
- func (*Metric) Descriptor() ([]byte, []int)deprecated
- func (x *Metric) GetControl() string
- func (x *Metric) GetDescription() string
- func (x *Metric) GetId() string
- func (x *Metric) GetName() string
- func (x *Metric) GetScale() string
- func (*Metric) ProtoMessage()
- func (x *Metric) ProtoReflect() protoreflect.Message
- func (x *Metric) Reset()
- func (x *Metric) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEvidenceMissing = errors.New("evidence is missing") ErrEvidenceIdInvalidFormat = errors.New("evidence id not in expected format (UUID) or missing") ErrTimestampMissing = errors.New("evidence timestamp is missing") ErrTargetServiceMissing = errors.New("evidence target service is missing") ErrEvidenceWithError = errors.New("evidence includes error") ErrValueMissing = errors.New("evidence value is missing") ErrValueNotStruct = errors.New("evidence value is no struct value") ErrValueNotMap = errors.New("evidence (struct) value is not convertible to map") )
View Source
var ( Error_Code_name = map[int32]string{ 0: "ERROR_UNKNOWN", 1: "ERROR_INVALID_CONFIGURATION", 2: "ERROR_CONNECTION_FAILURE", 3: "ERROR_PROTOCOL_VIOLATION", } Error_Code_value = map[string]int32{ "ERROR_UNKNOWN": 0, "ERROR_INVALID_CONFIGURATION": 1, "ERROR_CONNECTION_FAILURE": 2, "ERROR_PROTOCOL_VIOLATION": 3, } )
Enum value maps for Error_Code.
View Source
var File_api_common_evidence_proto protoreflect.FileDescriptor
View Source
var File_api_common_metric_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { // The type of error Code Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=cam.Error_Code" json:"code,omitempty"` // Optional. A human-readable description of the error. Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
An error result
func (*Error) Descriptor
deprecated
func (*Error) GetCode ¶
func (x *Error) GetCode() Error_Code
func (*Error) GetDescription ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type Error_Code ¶
type Error_Code int32
The broad type of error, should not be too collection module specific
const ( Error_ERROR_UNKNOWN Error_Code = 0 Error_ERROR_INVALID_CONFIGURATION Error_Code = 1 // The collection module configuration did not allow for collection // (e.g. Port number 1000000) Error_ERROR_CONNECTION_FAILURE Error_Code = 2 // The service could not be reached (e.g. Timeout) Error_ERROR_PROTOCOL_VIOLATION Error_Code = 3 // The service did not behave as expected )
func (Error_Code) Descriptor ¶
func (Error_Code) Descriptor() protoreflect.EnumDescriptor
func (Error_Code) Enum ¶
func (x Error_Code) Enum() *Error_Code
func (Error_Code) EnumDescriptor
deprecated
func (Error_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use Error_Code.Descriptor instead.
func (Error_Code) Number ¶
func (x Error_Code) Number() protoreflect.EnumNumber
func (Error_Code) String ¶
func (x Error_Code) String() string
func (Error_Code) Type ¶
func (Error_Code) Type() protoreflect.EnumType
type Evidence ¶
type Evidence struct { // The ID is a newly generated uuid Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Name equals the ID Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` TargetService string `protobuf:"bytes,3,opt,name=target_service,json=targetService,proto3" json:"target_service,omitempty"` // Optional. Specific to the service, e.g. resource ID within service TargetResource string `protobuf:"bytes,4,opt,name=target_resource,json=targetResource,proto3" json:"target_resource,omitempty"` // Reference to Metric (e.g. metric ID) GatheredUsing string `protobuf:"bytes,5,opt,name=gathered_using,json=gatheredUsing,proto3" json:"gathered_using,omitempty"` // Represents the collection module ToolId string `protobuf:"bytes,11,opt,name=tool_id,json=toolId,proto3" json:"tool_id,omitempty"` // Time of evidence creation GatheredAt *timestamppb.Timestamp `` /* 131-byte string literal not displayed */ // Conditional, Mutually exclusive with error. The measured value. Depends on // the type of evidence Value *structpb.Value `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty" gorm:"serializer:json"` // Conditional, Mutually exclusive with value. An error Error *Error `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty" gorm:"serializer:json"` // Optional. E.g. a JSON representation of the raw underlying evidence RawEvidence string `protobuf:"bytes,10,opt,name=raw_evidence,json=rawEvidence,proto3" json:"raw_evidence,omitempty"` // contains filtered or unexported fields }
An evidence resource
func (*Evidence) Descriptor
deprecated
func (*Evidence) GetGatheredAt ¶
func (x *Evidence) GetGatheredAt() *timestamppb.Timestamp
func (*Evidence) GetGatheredUsing ¶
func (*Evidence) GetRawEvidence ¶
func (*Evidence) GetTargetResource ¶
func (*Evidence) GetTargetService ¶
func (*Evidence) ProtoMessage ¶
func (*Evidence) ProtoMessage()
func (*Evidence) ProtoReflect ¶
func (x *Evidence) ProtoReflect() protoreflect.Message
func (*Evidence) ResourceTypes ¶
ResourceTypes parses the embedded resource of this evidence and returns its types according to the ontology.
type Metric ¶
type Metric struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Reference to the control: It is an ID according to OSCAL model Control string `protobuf:"bytes,4,opt,name=control,proto3" json:"control,omitempty"` Scale string `protobuf:"bytes,5,opt,name=scale,proto3" json:"scale,omitempty"` // contains filtered or unexported fields }
A metric resource TODO: Remove, Clouditor metric is used instead
func (*Metric) Descriptor
deprecated
func (*Metric) GetControl ¶
func (*Metric) GetDescription ¶
func (*Metric) ProtoMessage ¶
func (*Metric) ProtoMessage()
func (*Metric) ProtoReflect ¶
func (x *Metric) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.