jsonschema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deserializer

type Deserializer struct {
	serde.BaseDeserializer
	// contains filtered or unexported fields
}

Deserializer represents a JSON Schema deserializer

func NewDeserializer

func NewDeserializer(client schemaregistry.Client, serdeType serde.Type, conf *DeserializerConfig) (*Deserializer, error)

NewDeserializer creates a JSON deserializer for generic objects

func (*Deserializer) Deserialize

func (s *Deserializer) Deserialize(topic string, payload []byte) (interface{}, error)

Deserialize implements deserialization of generic data from JSON

func (*Deserializer) DeserializeInto

func (s *Deserializer) DeserializeInto(topic string, payload []byte, msg interface{}) error

DeserializeInto implements deserialization of generic data from JSON to the given object

type DeserializerConfig

type DeserializerConfig struct {
	serde.DeserializerConfig
	EnableValidation bool
}

DeserializerConfig is used to pass multiple configuration options to the deserializers.

func NewDeserializerConfig

func NewDeserializerConfig() *DeserializerConfig

NewDeserializerConfig returns a new configuration instance with sane defaults.

type Serializer

type Serializer struct {
	serde.BaseSerializer
	// contains filtered or unexported fields
}

Serializer represents a JSON Schema serializer

func NewSerializer

func NewSerializer(client schemaregistry.Client, serdeType serde.Type, conf *SerializerConfig) (*Serializer, error)

NewSerializer creates a JSON serializer for generic objects

func (*Serializer) Serialize

func (s *Serializer) Serialize(topic string, msg interface{}) ([]byte, error)

Serialize implements serialization of generic data to JSON

type SerializerConfig

type SerializerConfig struct {
	serde.SerializerConfig
	// EnableValidation enables validation of the JSON against the schema.
	EnableValidation bool
}

SerializerConfig is used to pass multiple configuration options to the serializers.

func NewSerializerConfig

func NewSerializerConfig() *SerializerConfig

NewSerializerConfig returns a new configuration instance with sane defaults.

Jump to

Keyboard shortcuts

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