Documentation ¶
Index ¶
Constants ¶
View Source
const AssertAction = "assert"
AssertAction represents assert action
View Source
const ServiceID = "validator"
ServiceID represents validator service id
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssertRequest ¶
type AssertRequest struct { TagID string Name string Description string Actual interface{} `required:"true" description:"actual value/data structure"` Expect interface{} `required:"true" description:"expected value/data structure"` Source interface{} //optional validation source Ignore interface{} OmitEmpty bool NormalizeKVPairs bool //flag to normalize kv pairs into map if possible (i.e, when using yaml) }
AssertRequest represent assert request
func NewAssertRequest ¶
func NewAssertRequest(tagID string, name string, description string, source, expected, actual interface{}) *AssertRequest
NewAssertRequest creates a new assertRequest
func NewAssertRequestFromContext ¶
func NewAssertRequestFromContext(context *endly.Context, source, expected, actual interface{}, name, description string) (*AssertRequest, error)
NewAssertRequestFromContext creates a new assert rquest from context for current activity
func (*AssertRequest) IgnoreKeys ¶
func (r *AssertRequest) IgnoreKeys() []interface{}
func (*AssertRequest) Init ¶
func (r *AssertRequest) Init() error
type AssertResponse ¶
type AssertResponse struct {
*assertly.Validation
}
AssertResponse represent validation response
func Assert ¶
func Assert(context *endly.Context, source, expected, actual interface{}, name, description string) (*AssertResponse, error)
Assert compares provided expected amd actual
func (*AssertResponse) Assertion ¶
func (r *AssertResponse) Assertion() []*assertly.Validation
Assertion returns validation slice
type TaggedAssert ¶
type TaggedAssert struct { TagID string Expected interface{} Actual interface{} }
TaggedAssert represents tagged with ID assert
Click to show internal directories.
Click to hide internal directories.