prototest

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestStruct_EvaluationStatus_name = map[int32]string{
		0: "STATUS_UNSPECIFIED",
		1: "COMPLIANT",
		2: "NOT_COMPLIANT",
		3: "PENDING",
	}
	TestStruct_EvaluationStatus_value = map[string]int32{
		"STATUS_UNSPECIFIED": 0,
		"COMPLIANT":          1,
		"NOT_COMPLIANT":      2,
		"PENDING":            3,
	}
)

Enum value maps for TestStruct_EvaluationStatus.

View Source
var File_internal_testutil_prototest_prototest_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type TestStruct

type TestStruct struct {
	TestName        string                      `protobuf:"bytes,1,opt,name=test_name,json=testName,proto3" json:"test_name,omitempty"`
	TestId          string                      `protobuf:"bytes,2,opt,name=test_id,json=testId,proto3" json:"test_id,omitempty"`
	TestDescription string                      `protobuf:"bytes,3,opt,name=test_description,json=testDescription,proto3" json:"test_description,omitempty"`
	TestStatus      TestStruct_EvaluationStatus `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

This is a test message. If a test needs a proto message, that one can be used. This has been created because of import cycles in the package util.

func (*TestStruct) Descriptor deprecated

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

Deprecated: Use TestStruct.ProtoReflect.Descriptor instead.

func (*TestStruct) GetTestDescription

func (x *TestStruct) GetTestDescription() string

func (*TestStruct) GetTestId

func (x *TestStruct) GetTestId() string

func (*TestStruct) GetTestName

func (x *TestStruct) GetTestName() string

func (*TestStruct) GetTestStatus

func (x *TestStruct) GetTestStatus() TestStruct_EvaluationStatus

func (*TestStruct) ProtoMessage

func (*TestStruct) ProtoMessage()

func (*TestStruct) ProtoReflect

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

func (*TestStruct) Reset

func (x *TestStruct) Reset()

func (*TestStruct) String

func (x *TestStruct) String() string

func (*TestStruct) Validate

func (m *TestStruct) Validate() error

Validate checks the field values on TestStruct with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TestStruct) ValidateAll

func (m *TestStruct) ValidateAll() error

ValidateAll checks the field values on TestStruct with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TestStructMultiError, or nil if none found.

type TestStructMultiError

type TestStructMultiError []error

TestStructMultiError is an error wrapping multiple validation errors returned by TestStruct.ValidateAll() if the designated constraints aren't met.

func (TestStructMultiError) AllErrors

func (m TestStructMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TestStructMultiError) Error

func (m TestStructMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type TestStructValidationError

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

TestStructValidationError is the validation error returned by TestStruct.Validate if the designated constraints aren't met.

func (TestStructValidationError) Cause

func (e TestStructValidationError) Cause() error

Cause function returns cause value.

func (TestStructValidationError) Error

Error satisfies the builtin error interface

func (TestStructValidationError) ErrorName

func (e TestStructValidationError) ErrorName() string

ErrorName returns error name.

func (TestStructValidationError) Field

Field function returns field value.

func (TestStructValidationError) Key

Key function returns key value.

func (TestStructValidationError) Reason

func (e TestStructValidationError) Reason() string

Reason function returns reason value.

type TestStruct_EvaluationStatus

type TestStruct_EvaluationStatus int32
const (
	TestStruct_STATUS_UNSPECIFIED TestStruct_EvaluationStatus = 0
	TestStruct_COMPLIANT          TestStruct_EvaluationStatus = 1
	TestStruct_NOT_COMPLIANT      TestStruct_EvaluationStatus = 2
	TestStruct_PENDING            TestStruct_EvaluationStatus = 3
)

func (TestStruct_EvaluationStatus) Descriptor

func (TestStruct_EvaluationStatus) Enum

func (TestStruct_EvaluationStatus) EnumDescriptor deprecated

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

Deprecated: Use TestStruct_EvaluationStatus.Descriptor instead.

func (TestStruct_EvaluationStatus) Number

func (TestStruct_EvaluationStatus) String

func (TestStruct_EvaluationStatus) Type

Jump to

Keyboard shortcuts

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