validation

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAttribute added in v0.5.0

func ValidateAttribute(definition *base.EntityDefinition, reqAttribute *base.Attribute) (err error)

ValidateAttribute checks whether a given attribute request (reqAttribute) aligns with the attribute definition in a given entity definition. It verifies if the attribute exists in the entity definition and if the attribute type matches the type specified in the request. If the attribute value is not of the expected type, an error is returned.

'definition' is the entity definition containing the definitions of valid attributes. 'reqAttribute' is the attribute that needs to be validated against the entity definition.

Returns nil if the attribute is valid, otherwise returns an error.

func ValidateTuple

func ValidateTuple(definition *base.EntityDefinition, tup *base.Tuple) (err error)

ValidateTuple checks if the provided tuple conforms to the entity definition and relation schema provided. It returns an error if the tuple is invalid.

func ValidateTupleFilter added in v0.5.0

func ValidateTupleFilter(filter *base.TupleFilter) (err error)

ValidateTupleFilter checks if the provided filter conforms to the entity definition

Types

This section is empty.

Jump to

Keyboard shortcuts

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