schema_cache

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MirSchemaCache added in v0.3.1

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

func NewMirSchemaCache added in v0.3.1

func NewMirSchemaCache(logger zerolog.Logger, m *mir.Mir) (*MirSchemaCache, error)

func (*MirSchemaCache) AddDeviceUpdateSub added in v0.3.1

func (c *MirSchemaCache) AddDeviceUpdateSub(fn func(deviceId string, device mir_v1.Device, schema mir_proto.MirProtoSchema))

func (*MirSchemaCache) FindMessageDescriptor added in v0.3.1

func (c *MirSchemaCache) FindMessageDescriptor(deviceId string, sch *mir_proto.MirProtoSchema, msgName string) (protoreflect.Descriptor, *mir_proto.MirProtoSchema, error)

func (*MirSchemaCache) GetDeviceSchema added in v0.3.1

func (c *MirSchemaCache) GetDeviceSchema(deviceId string, refreshSchema bool) (*mir_proto.MirProtoSchema, mir_v1.Device, error)

Get the device schema from cache. If missing or refresh schema is true, the cache will be invalidated and schema will be fetch from database or device

func (*MirSchemaCache) GetDeviceSchemaAndDescriptor added in v0.3.1

func (c *MirSchemaCache) GetDeviceSchemaAndDescriptor(deviceId string, descName string, refreshSchema bool) (protoreflect.Descriptor, *mir_proto.MirProtoSchema, mir_v1.Device, error)

Get device schema and descriptor from cache If schema missing, get from db. If db missing, fetch from device. If refreshSchema is true, force refresh from db

func (*MirSchemaCache) GetDynamicMsg added in v0.3.1

func (c *MirSchemaCache) GetDynamicMsg(deviceId string, protoMsgName string, data []byte) (*dynamicpb.Message, error)

Directories

Path Synopsis
proto_test

Jump to

Keyboard shortcuts

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