Documentation ¶
Index ¶
- func ConvertJsonToMap(jsonData string) (map[string]string, error)
- func ConvertMapToJson(data map[string]string) ([]byte, error)
- func GenerateUniqueKeyForValues(data map[string]string, keyNames []string) (string, error)
- func ValidateMap[T any](schema *jsonschema.Schema, data map[string]T) error
- type JsonSchemaValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateUniqueKeyForValues ¶
Generates unique SHA256 based unique key for the values in the map for the given keys
func ValidateMap ¶
New function for validating map with generic type parameter
Types ¶
type JsonSchemaValidator ¶
type JsonSchemaValidator struct {
// contains filtered or unexported fields
}
func NewJsonSchemaValidator ¶
func NewJsonSchemaValidator(schemaDirectory string) (*JsonSchemaValidator, error)
func (*JsonSchemaValidator) GetUniqueKeys ¶
func (v *JsonSchemaValidator) GetUniqueKeys(schemaId string) ([]string, error)
func (*JsonSchemaValidator) ValidateJson ¶
func (v *JsonSchemaValidator) ValidateJson(schemaId string, jsonObject any) error
func (*JsonSchemaValidator) ValidateMap ¶
func (v *JsonSchemaValidator) ValidateMap(schemaId string, data map[string]any) error
Click to show internal directories.
Click to hide internal directories.