Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JSONSchema = &Schema{}
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct { jsonschema.Schema Lock sync.Mutex }
func GlobalJSONSchema ¶
func GlobalJSONSchema() *Schema
This approach is bad, and we are not the ones implementing this. The qri-io/jsonschema internally is creating a global instance of Schema. Hence for concurrent operations, we have to make sure that the package qri-io/jsonschema is accessed in a thread-safe way. So use this Global instance for now.
func (*Schema) ValidateBytes ¶
JsonSchema package creates a global instance(without any locks) of Schema struct which panics when concurrent routines try to call ValidateBytes. So this package creates a thin shim to avoid internal concurrent map writes
Click to show internal directories.
Click to hide internal directories.