schema_registry

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemorySchemaRegistry

type InMemorySchemaRegistry struct {
	// contains filtered or unexported fields
}

func NewInMemorySchemaRegistry

func NewInMemorySchemaRegistry(logger *zap.Logger) *InMemorySchemaRegistry

func (*InMemorySchemaRegistry) GetSchema

func (fsr *InMemorySchemaRegistry) GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool)

GetSchema retrieves a schema for a specific OCPP version and action.

func (*InMemorySchemaRegistry) RegisterSchema

func (fsr *InMemorySchemaRegistry) RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage, opts ...Option) error

RegisterSchema registers a new schema for a specific OCPP version and action. Example: you would register a schema for the action "BootNotification" in OCPP 1.6 like this:

err := schemaRegistry.RegisterSchema(ocpp.V16, "BootNotificationRequest", "{...}")

The rawSchema should be a valid JSON schema in raw format. The action is the name of the OCPP action that this schema applies to. Must be suffixed with either "Request" or "Response".

type Option

type Option func(*Options)

func WithOverwrite

func WithOverwrite(overwrite bool) Option

WithOverwrite allows overwriting existing schemasPerOcppVersion in the registry

type Options

type Options struct {
	// contains filtered or unexported fields
}

type SchemaRegistry

type SchemaRegistry interface {
	RegisterSchema(ocppVersion ocpp.Version, action string, rawSchema json.RawMessage, opts ...Option) error
	GetSchema(ocppVersion ocpp.Version, action string) (*jsonschema.Schema, bool)
}

Jump to

Keyboard shortcuts

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