Documentation
¶
Index ¶
- type MirSchemaCache
- func (c *MirSchemaCache) AddDeviceUpdateSub(...)
- func (c *MirSchemaCache) FindMessageDescriptor(deviceId string, sch *mir_proto.MirProtoSchema, msgName string) (protoreflect.Descriptor, *mir_proto.MirProtoSchema, error)
- func (c *MirSchemaCache) GetDeviceSchema(deviceId string, refreshSchema bool) (*mir_proto.MirProtoSchema, mir_v1.Device, error)
- func (c *MirSchemaCache) GetDeviceSchemaAndDescriptor(deviceId string, descName string, refreshSchema bool) (protoreflect.Descriptor, *mir_proto.MirProtoSchema, mir_v1.Device, error)
- func (c *MirSchemaCache) GetDynamicMsg(deviceId string, protoMsgName string, data []byte) (*dynamicpb.Message, error)
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 (*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
Click to show internal directories.
Click to hide internal directories.