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 ¶
WithOverwrite allows overwriting existing schemasPerOcppVersion in the registry
type SchemaRegistry ¶
Click to show internal directories.
Click to hide internal directories.