Documentation
¶
Index ¶
- Constants
- func CreateSchema(db bun.IDB) error
- func Seed(db *bun.DB) error
- type AttrService
- func (s *AttrService) Clone(ctx context.Context, in *cores.AttrCloneRequest) (*pb.MyBool, error)
- func (s *AttrService) Create(ctx context.Context, in *pb.Attr) (*pb.Attr, error)
- func (s *AttrService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *AttrService) GC()
- func (s *AttrService) GetValue(ctx context.Context, in *pb.Id) (*pb.AttrValue, error)
- func (s *AttrService) GetValueByName(ctx context.Context, in *cores.AttrGetValueByNameRequest) (*cores.AttrNameValue, error)
- func (s *AttrService) List(ctx context.Context, in *cores.AttrListRequest) (*cores.AttrListResponse, error)
- func (s *AttrService) Name(ctx context.Context, in *cores.AttrNameRequest) (*pb.Attr, error)
- func (s *AttrService) NameFull(ctx context.Context, in *pb.Name) (*pb.Attr, error)
- func (s *AttrService) Pull(ctx context.Context, in *cores.AttrPullRequest) (*cores.AttrPullResponse, error)
- func (s *AttrService) SetValue(ctx context.Context, in *pb.AttrValue) (*pb.MyBool, error)
- func (s *AttrService) SetValueByName(ctx context.Context, in *cores.AttrNameValue) (*pb.MyBool, error)
- func (s *AttrService) SetValueByNameForce(ctx context.Context, in *cores.AttrNameValue) (*pb.MyBool, error)
- func (s *AttrService) SetValueForce(ctx context.Context, in *pb.AttrValue) (*pb.MyBool, error)
- func (s *AttrService) Sync(ctx context.Context, in *pb.Attr) (*pb.MyBool, error)
- func (s *AttrService) Update(ctx context.Context, in *pb.Attr) (*pb.Attr, error)
- func (s *AttrService) Upload(ctx context.Context, in *cores.AttrValueUploadRequest) (*cores.AttrValueUploadResponse, error)
- func (s *AttrService) View(ctx context.Context, in *pb.Id) (*pb.Attr, error)
- func (s *AttrService) ViewByClassIDAndName(ctx context.Context, classID, name string) (model.Attr, error)
- func (s *AttrService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Attr, error)
- func (s *AttrService) ViewByID(ctx context.Context, id string) (model.Attr, error)
- func (s *AttrService) ViewFromCacheByClassIDAndName(ctx context.Context, classID, name string) (model.Attr, error)
- func (s *AttrService) ViewFromCacheByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Attr, error)
- func (s *AttrService) ViewFromCacheByID(ctx context.Context, id string) (model.Attr, error)
- func (s *AttrService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Attr, error)
- type AuthService
- func (s *AuthService) ChangePass(ctx context.Context, in *cores.ChangePassRequest) (*pb.Message, error)
- func (s *AuthService) ForceChangePass(ctx context.Context, in *cores.ForceChangePassRequest) (*pb.Message, error)
- func (s *AuthService) Login(ctx context.Context, in *cores.LoginRequest) (*cores.LoginResponse, error)
- type ClassService
- func (s *ClassService) Clone(ctx context.Context, in *cores.ClassCloneRequest) (*pb.MyBool, error)
- func (s *ClassService) Create(ctx context.Context, in *pb.Class) (*pb.Class, error)
- func (s *ClassService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *ClassService) GC()
- func (s *ClassService) List(ctx context.Context, in *cores.ClassListRequest) (*cores.ClassListResponse, error)
- func (s *ClassService) Name(ctx context.Context, in *cores.ClassNameRequest) (*pb.Class, error)
- func (s *ClassService) NameFull(ctx context.Context, in *pb.Name) (*pb.Class, error)
- func (s *ClassService) Pull(ctx context.Context, in *cores.ClassPullRequest) (*cores.ClassPullResponse, error)
- func (s *ClassService) Sync(ctx context.Context, in *pb.Class) (*pb.MyBool, error)
- func (s *ClassService) Update(ctx context.Context, in *pb.Class) (*pb.Class, error)
- func (s *ClassService) View(ctx context.Context, in *pb.Id) (*pb.Class, error)
- func (s *ClassService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Class, error)
- func (s *ClassService) ViewByID(ctx context.Context, id string) (model.Class, error)
- func (s *ClassService) ViewFromCacheByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Class, error)
- func (s *ClassService) ViewFromCacheByID(ctx context.Context, id string) (model.Class, error)
- func (s *ClassService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Class, error)
- type ConstService
- func (s *ConstService) Clone(ctx context.Context, in *cores.ConstCloneRequest) (*pb.MyBool, error)
- func (s *ConstService) Create(ctx context.Context, in *pb.Const) (*pb.Const, error)
- func (s *ConstService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *ConstService) GC()
- func (s *ConstService) GetValue(ctx context.Context, in *pb.Id) (*pb.ConstValue, error)
- func (s *ConstService) GetValueByName(ctx context.Context, in *cores.ConstGetValueByNameRequest) (*cores.ConstNameValue, error)
- func (s *ConstService) List(ctx context.Context, in *cores.ConstListRequest) (*cores.ConstListResponse, error)
- func (s *ConstService) Name(ctx context.Context, in *cores.ConstNameRequest) (*pb.Const, error)
- func (s *ConstService) NameFull(ctx context.Context, in *pb.Name) (*pb.Const, error)
- func (s *ConstService) Pull(ctx context.Context, in *cores.ConstPullRequest) (*cores.ConstPullResponse, error)
- func (s *ConstService) SetValue(ctx context.Context, in *pb.ConstValue) (*pb.MyBool, error)
- func (s *ConstService) SetValueByName(ctx context.Context, in *cores.ConstNameValue) (*pb.MyBool, error)
- func (s *ConstService) SetValueByNameForce(ctx context.Context, in *cores.ConstNameValue) (*pb.MyBool, error)
- func (s *ConstService) SetValueForce(ctx context.Context, in *pb.ConstValue) (*pb.MyBool, error)
- func (s *ConstService) Sync(ctx context.Context, in *pb.Const) (*pb.MyBool, error)
- func (s *ConstService) Update(ctx context.Context, in *pb.Const) (*pb.Const, error)
- func (s *ConstService) View(ctx context.Context, in *pb.Id) (*pb.Const, error)
- func (s *ConstService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Const, error)
- func (s *ConstService) ViewByID(ctx context.Context, id string) (model.Const, error)
- func (s *ConstService) ViewFromCacheByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Const, error)
- func (s *ConstService) ViewFromCacheByID(ctx context.Context, id string) (model.Const, error)
- func (s *ConstService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Const, error)
- type ControlService
- func (s *ControlService) AddClient(deviceID string, client cores.ControlServiceClient)
- func (s *ControlService) GetClient(deviceID string) types.Option[cores.ControlServiceClient]
- func (s *ControlService) GetTagValue(ctx context.Context, in *pb.Id) (*pb.TagValue, error)
- func (s *ControlService) RemoveClient(deviceID string, client cores.ControlServiceClient)
- func (s *ControlService) SetTagValue(ctx context.Context, in *pb.TagValue) (*pb.TagValue, error)
- type CoreOption
- func WithCache(enable bool) CoreOption
- func WithCacheGCTTL(d time.Duration) CoreOption
- func WithCacheTTL(d time.Duration) CoreOption
- func WithInfluxDB(influxdb *db.InfluxDB) CoreOption
- func WithLinkTTL(d time.Duration) CoreOption
- func WithLogger(logger *zap.Logger) CoreOption
- func WithSave(enable bool) CoreOption
- func WithSaveInterval(d time.Duration) CoreOption
- type CoreService
- func (cs *CoreService) Context() context.Context
- func (cs *CoreService) GetAttr() *AttrService
- func (cs *CoreService) GetAuth() *AuthService
- func (cs *CoreService) GetClass() *ClassService
- func (cs *CoreService) GetConst() *ConstService
- func (cs *CoreService) GetControl() *ControlService
- func (cs *CoreService) GetDB() *bun.DB
- func (cs *CoreService) GetData() *DataService
- func (cs *CoreService) GetDevice() *DeviceService
- func (cs *CoreService) GetFn() *FnService
- func (cs *CoreService) GetInfluxDB() types.Option[*db.InfluxDB]
- func (cs *CoreService) GetLogic() *LogicService
- func (cs *CoreService) GetSave() types.Option[*SaveService]
- func (cs *CoreService) GetSlot() *SlotService
- func (cs *CoreService) GetSource() *SourceService
- func (cs *CoreService) GetStatus() *StatusService
- func (cs *CoreService) GetSync() *SyncService
- func (cs *CoreService) GetSyncGlobal() *SyncGlobalService
- func (cs *CoreService) GetTag() *TagService
- func (cs *CoreService) GetUser() *UserService
- func (cs *CoreService) Logger() *zap.Logger
- func (cs *CoreService) Register(server *grpc.Server)
- func (cs *CoreService) Start()
- func (cs *CoreService) Stop()
- type DataService
- func (s *DataService) CheckDataTypeJson(tag *model.Tag, value any) (nson.Value, error)
- func (s *DataService) CheckDataTypeNson(tag *model.Tag, value nson.Value) error
- func (s *DataService) Compile(ctx context.Context, in *cores.DataQueryRequest) (*pb.Message, error)
- func (s *DataService) GetValue(tagID string) types.Option[cache.Value[nson.Value]]
- func (s *DataService) NewPoint(tag *model.Tag, value float64, timestamp int64) *write.Point
- func (s *DataService) Query(in *cores.DataQueryRequest, stream cores.DataService_QueryServer) error
- func (s *DataService) QueryById(in *cores.DataQueryByIdRequest, stream cores.DataService_QueryByIdServer) error
- func (s *DataService) SetValue(tagID string, value nson.Value)
- func (s *DataService) UpdateValue(tag *model.Tag, value nson.Value)
- func (s *DataService) Upload(ctx context.Context, in *cores.DataUploadRequest) (*cores.DataUploadResponse, error)
- type DeviceService
- func (s *DeviceService) Clone(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *DeviceService) Create(ctx context.Context, in *pb.Device) (*pb.Device, error)
- func (s *DeviceService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *DeviceService) Destory(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *DeviceService) GC()
- func (s *DeviceService) Link(ctx context.Context, in *cores.DeviceLinkRequest) (*pb.MyBool, error)
- func (s *DeviceService) List(ctx context.Context, in *cores.DeviceListRequest) (*cores.DeviceListResponse, error)
- func (s *DeviceService) Name(ctx context.Context, in *pb.Name) (*pb.Device, error)
- func (s *DeviceService) Pull(ctx context.Context, in *cores.DevicePullRequest) (*cores.DevicePullResponse, error)
- func (s *DeviceService) Sync(ctx context.Context, in *pb.Device) (*pb.MyBool, error)
- func (s *DeviceService) Update(ctx context.Context, in *pb.Device) (*pb.Device, error)
- func (s *DeviceService) View(ctx context.Context, in *pb.Id) (*pb.Device, error)
- func (s *DeviceService) ViewByID(ctx context.Context, id string) (model.Device, error)
- func (s *DeviceService) ViewByName(ctx context.Context, name string) (model.Device, error)
- func (s *DeviceService) ViewFromCacheByID(ctx context.Context, id string) (model.Device, error)
- func (s *DeviceService) ViewFromCacheByName(ctx context.Context, name string) (model.Device, error)
- func (s *DeviceService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Device, error)
- type FnService
- func (s *FnService) Clone(ctx context.Context, in *cores.CloneFnRequest) (*pb.MyBool, error)
- func (s *FnService) Create(ctx context.Context, in *pb.Fn) (*pb.Fn, error)
- func (s *FnService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *FnService) Link(ctx context.Context, in *cores.FnLinkRequest) (*pb.MyBool, error)
- func (s *FnService) List(ctx context.Context, in *cores.FnListRequest) (*cores.FnListResponse, error)
- func (s *FnService) Name(ctx context.Context, in *cores.FnNameRequest) (*pb.Fn, error)
- func (s *FnService) Pull(ctx context.Context, in *cores.FnPullRequest) (*cores.FnPullResponse, error)
- func (s *FnService) Sync(ctx context.Context, in *pb.Fn) (*pb.MyBool, error)
- func (s *FnService) Update(ctx context.Context, in *pb.Fn) (*pb.Fn, error)
- func (s *FnService) View(ctx context.Context, in *pb.Id) (*pb.Fn, error)
- func (s *FnService) ViewByID(ctx context.Context, id string) (model.Fn, error)
- func (s *FnService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Fn, error)
- type GlobalNotify
- type LogicService
- func (s *LogicService) Clone(ctx context.Context, in *cores.LogicCloneRequest) (*pb.MyBool, error)
- func (s *LogicService) Create(ctx context.Context, in *pb.Logic) (*pb.Logic, error)
- func (s *LogicService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *LogicService) List(ctx context.Context, in *cores.LogicListRequest) (*cores.LogicListResponse, error)
- func (s *LogicService) Name(ctx context.Context, in *cores.LogicNameRequest) (*pb.Logic, error)
- func (s *LogicService) Pull(ctx context.Context, in *cores.LogicPullRequest) (*cores.LogicPullResponse, error)
- func (s *LogicService) Sync(ctx context.Context, in *pb.Logic) (*pb.MyBool, error)
- func (s *LogicService) Update(ctx context.Context, in *pb.Logic) (*pb.Logic, error)
- func (s *LogicService) View(ctx context.Context, in *pb.Id) (*pb.Logic, error)
- func (s *LogicService) ViewByID(ctx context.Context, id string) (model.Logic, error)
- func (s *LogicService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Logic, error)
- type Notify
- type NotifyType
- type SaveService
- type SlotService
- func (s *SlotService) Clone(ctx context.Context, in *cores.SlotCloneRequest) (*pb.MyBool, error)
- func (s *SlotService) Create(ctx context.Context, in *pb.Slot) (*pb.Slot, error)
- func (s *SlotService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *SlotService) Link(ctx context.Context, in *cores.SlotLinkRequest) (*pb.MyBool, error)
- func (s *SlotService) List(ctx context.Context, in *cores.SlotListRequest) (*cores.SlotListResponse, error)
- func (s *SlotService) Name(ctx context.Context, in *cores.SlotNameRequest) (*pb.Slot, error)
- func (s *SlotService) NameFull(ctx context.Context, in *pb.Name) (*pb.Slot, error)
- func (s *SlotService) Pull(ctx context.Context, in *cores.SlotPullRequest) (*cores.SlotPullResponse, error)
- func (s *SlotService) Sync(ctx context.Context, in *pb.Slot) (*pb.MyBool, error)
- func (s *SlotService) Update(ctx context.Context, in *pb.Slot) (*pb.Slot, error)
- func (s *SlotService) View(ctx context.Context, in *pb.Id) (*pb.Slot, error)
- func (s *SlotService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Slot, error)
- func (s *SlotService) ViewByID(ctx context.Context, id string) (model.Slot, error)
- func (s *SlotService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Slot, error)
- type SourceService
- func (s *SourceService) Clone(ctx context.Context, in *cores.SourceCloneRequest) (*pb.MyBool, error)
- func (s *SourceService) Create(ctx context.Context, in *pb.Source) (*pb.Source, error)
- func (s *SourceService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *SourceService) GC()
- func (s *SourceService) Link(ctx context.Context, in *cores.SourceLinkRequest) (*pb.MyBool, error)
- func (s *SourceService) List(ctx context.Context, in *cores.SourceListRequest) (*cores.SourceListResponse, error)
- func (s *SourceService) Name(ctx context.Context, in *cores.SourceNameRequest) (*pb.Source, error)
- func (s *SourceService) NameFull(ctx context.Context, in *pb.Name) (*pb.Source, error)
- func (s *SourceService) Pull(ctx context.Context, in *cores.SourcePullRequest) (*cores.SourcePullResponse, error)
- func (s *SourceService) Sync(ctx context.Context, in *pb.Source) (*pb.MyBool, error)
- func (s *SourceService) Update(ctx context.Context, in *pb.Source) (*pb.Source, error)
- func (s *SourceService) View(ctx context.Context, in *pb.Id) (*pb.Source, error)
- func (s *SourceService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Source, error)
- func (s *SourceService) ViewByID(ctx context.Context, id string) (model.Source, error)
- func (s *SourceService) ViewFromCacheByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Source, error)
- func (s *SourceService) ViewFromCacheByID(ctx context.Context, id string) (model.Source, error)
- func (s *SourceService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Source, error)
- type StatusService
- type SyncGlobalService
- func (s *SyncGlobalService) GetUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
- func (s *SyncGlobalService) Notify(id string) *GlobalNotify
- func (s *SyncGlobalService) SetUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
- func (s *SyncGlobalService) WaitDeviceUpdated(in *pb.Id, stream cores.SyncGlobalService_WaitUpdatedServer) error
- type SyncService
- func (s *SyncService) GetDeviceUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
- func (s *SyncService) GetTagValueUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
- func (s *SyncService) Notify(id string, nt NotifyType) *Notify
- func (s *SyncService) SetDeviceUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
- func (s *SyncService) SetTagValueUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
- func (s *SyncService) WaitDeviceUpdated(in *pb.Id, stream cores.SyncService_WaitDeviceUpdatedServer) error
- func (s *SyncService) WaitTagValueUpdated(in *pb.Id, stream cores.SyncService_WaitTagValueUpdatedServer) error
- type TagService
- func (s *TagService) Clone(ctx context.Context, in *cores.TagCloneRequest) (*pb.MyBool, error)
- func (s *TagService) Create(ctx context.Context, in *pb.Tag) (*pb.Tag, error)
- func (s *TagService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *TagService) DeleteValue(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *TagService) GC()
- func (s *TagService) GetValue(ctx context.Context, in *pb.Id) (*pb.TagValue, error)
- func (s *TagService) GetValueByName(ctx context.Context, in *cores.TagGetValueByNameRequest) (*cores.TagNameValue, error)
- func (s *TagService) List(ctx context.Context, in *cores.TagListRequest) (*cores.TagListResponse, error)
- func (s *TagService) Name(ctx context.Context, in *cores.TagNameRequest) (*pb.Tag, error)
- func (s *TagService) NameFull(ctx context.Context, in *pb.Name) (*pb.Tag, error)
- func (s *TagService) Pull(ctx context.Context, in *cores.TagPullRequest) (*cores.TagPullResponse, error)
- func (s *TagService) PullValue(ctx context.Context, in *cores.TagPullValueRequest) (*cores.TagPullValueResponse, error)
- func (s *TagService) SetValue(ctx context.Context, in *pb.TagValue) (*pb.MyBool, error)
- func (s *TagService) SetValueByName(ctx context.Context, in *cores.TagNameValue) (*pb.MyBool, error)
- func (s *TagService) SetValueByNameForce(ctx context.Context, in *cores.TagNameValue) (*pb.MyBool, error)
- func (s *TagService) SetValueForce(ctx context.Context, in *pb.TagValue) (*pb.MyBool, error)
- func (s *TagService) Sync(ctx context.Context, in *pb.Tag) (*pb.MyBool, error)
- func (s *TagService) SyncValue(ctx context.Context, in *pb.TagValue) (*pb.MyBool, error)
- func (s *TagService) Update(ctx context.Context, in *pb.Tag) (*pb.Tag, error)
- func (s *TagService) View(ctx context.Context, in *pb.Id) (*pb.Tag, error)
- func (s *TagService) ViewByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Tag, error)
- func (s *TagService) ViewByID(ctx context.Context, id string) (model.Tag, error)
- func (s *TagService) ViewBySourceIDAndAddress(ctx context.Context, sourceID, address string) (model.Tag, error)
- func (s *TagService) ViewBySourceIDAndName(ctx context.Context, sourceID, name string) (model.Tag, error)
- func (s *TagService) ViewFromCacheByDeviceIDAndName(ctx context.Context, deviceID, name string) (model.Tag, error)
- func (s *TagService) ViewFromCacheByID(ctx context.Context, id string) (model.Tag, error)
- func (s *TagService) ViewFromCacheBySourceIDAndAddress(ctx context.Context, sourceID, address string) (model.Tag, error)
- func (s *TagService) ViewFromCacheBySourceIDAndName(ctx context.Context, sourceID, name string) (model.Tag, error)
- func (s *TagService) ViewValue(ctx context.Context, in *pb.Id) (*pb.TagValueUpdated, error)
- func (s *TagService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.Tag, error)
- type UserService
- func (s *UserService) Create(ctx context.Context, in *pb.User) (*pb.User, error)
- func (s *UserService) Delete(ctx context.Context, in *pb.Id) (*pb.MyBool, error)
- func (s *UserService) GC()
- func (s *UserService) List(ctx context.Context, in *cores.UserListRequest) (*cores.UserListResponse, error)
- func (s *UserService) Name(ctx context.Context, in *pb.Name) (*pb.User, error)
- func (s *UserService) Pull(ctx context.Context, in *cores.UserPullRequest) (*cores.UserPullResponse, error)
- func (s *UserService) Update(ctx context.Context, in *pb.User) (*pb.User, error)
- func (s *UserService) View(ctx context.Context, in *pb.Id) (*pb.User, error)
- func (s *UserService) ViewByID(ctx context.Context, id string) (model.User, error)
- func (s *UserService) ViewByName(ctx context.Context, name string) (model.User, error)
- func (s *UserService) ViewFromCacheByID(ctx context.Context, id string) (model.User, error)
- func (s *UserService) ViewFromCacheByName(ctx context.Context, name string) (model.User, error)
- func (s *UserService) ViewWithDeleted(ctx context.Context, in *pb.Id) (*pb.User, error)
Constants ¶
View Source
const ( UPLOAD_PREFIX = "__" UPLOAD_SOURCE = "__src" UPLOAD_TIMESTAMP = "__ts" UPLOAD_TYPE = "__type" UPLOAD_TYPE_NAME uint32 = 0 UPLOAD_TYPE_ADDRESS uint32 = 1 UPLOAD_NAME = "__name" UPLOAD_VALUES = "__vs" )
Variables ¶
This section is empty.
Functions ¶
func CreateSchema ¶
Types ¶
type AttrService ¶
type AttrService struct { cores.UnimplementedAttrServiceServer // contains filtered or unexported fields }
func (*AttrService) Clone ¶
func (s *AttrService) Clone(ctx context.Context, in *cores.AttrCloneRequest) (*pb.MyBool, error)
func (*AttrService) GC ¶
func (s *AttrService) GC()
func (*AttrService) GetValueByName ¶
func (s *AttrService) GetValueByName(ctx context.Context, in *cores.AttrGetValueByNameRequest) (*cores.AttrNameValue, error)
func (*AttrService) List ¶
func (s *AttrService) List(ctx context.Context, in *cores.AttrListRequest) (*cores.AttrListResponse, error)
func (*AttrService) Name ¶
func (s *AttrService) Name(ctx context.Context, in *cores.AttrNameRequest) (*pb.Attr, error)
func (*AttrService) Pull ¶
func (s *AttrService) Pull(ctx context.Context, in *cores.AttrPullRequest) (*cores.AttrPullResponse, error)
func (*AttrService) SetValueByName ¶
func (s *AttrService) SetValueByName(ctx context.Context, in *cores.AttrNameValue) (*pb.MyBool, error)
func (*AttrService) SetValueByNameForce ¶
func (s *AttrService) SetValueByNameForce(ctx context.Context, in *cores.AttrNameValue) (*pb.MyBool, error)
func (*AttrService) SetValueForce ¶
func (*AttrService) Upload ¶
func (s *AttrService) Upload(ctx context.Context, in *cores.AttrValueUploadRequest) (*cores.AttrValueUploadResponse, error)
func (*AttrService) ViewByClassIDAndName ¶
func (*AttrService) ViewByDeviceIDAndName ¶
func (*AttrService) ViewFromCacheByClassIDAndName ¶
func (*AttrService) ViewFromCacheByDeviceIDAndName ¶
func (*AttrService) ViewFromCacheByID ¶
func (*AttrService) ViewWithDeleted ¶
type AuthService ¶
type AuthService struct { cores.UnimplementedAuthServiceServer // contains filtered or unexported fields }
func (*AuthService) ChangePass ¶
func (s *AuthService) ChangePass(ctx context.Context, in *cores.ChangePassRequest) (*pb.Message, error)
func (*AuthService) ForceChangePass ¶
func (s *AuthService) ForceChangePass(ctx context.Context, in *cores.ForceChangePassRequest) (*pb.Message, error)
func (*AuthService) Login ¶
func (s *AuthService) Login(ctx context.Context, in *cores.LoginRequest) (*cores.LoginResponse, error)
type ClassService ¶
type ClassService struct { cores.UnimplementedClassServiceServer // contains filtered or unexported fields }
func (*ClassService) Clone ¶
func (s *ClassService) Clone(ctx context.Context, in *cores.ClassCloneRequest) (*pb.MyBool, error)
func (*ClassService) GC ¶
func (s *ClassService) GC()
func (*ClassService) List ¶
func (s *ClassService) List(ctx context.Context, in *cores.ClassListRequest) (*cores.ClassListResponse, error)
func (*ClassService) Name ¶
func (s *ClassService) Name(ctx context.Context, in *cores.ClassNameRequest) (*pb.Class, error)
func (*ClassService) Pull ¶
func (s *ClassService) Pull(ctx context.Context, in *cores.ClassPullRequest) (*cores.ClassPullResponse, error)
func (*ClassService) ViewByDeviceIDAndName ¶
func (*ClassService) ViewFromCacheByDeviceIDAndName ¶
func (*ClassService) ViewFromCacheByID ¶
func (*ClassService) ViewWithDeleted ¶
type ConstService ¶
type ConstService struct { cores.UnimplementedConstServiceServer // contains filtered or unexported fields }
func (*ConstService) Clone ¶
func (s *ConstService) Clone(ctx context.Context, in *cores.ConstCloneRequest) (*pb.MyBool, error)
func (*ConstService) GC ¶
func (s *ConstService) GC()
func (*ConstService) GetValue ¶
func (s *ConstService) GetValue(ctx context.Context, in *pb.Id) (*pb.ConstValue, error)
func (*ConstService) GetValueByName ¶
func (s *ConstService) GetValueByName(ctx context.Context, in *cores.ConstGetValueByNameRequest) (*cores.ConstNameValue, error)
func (*ConstService) List ¶
func (s *ConstService) List(ctx context.Context, in *cores.ConstListRequest) (*cores.ConstListResponse, error)
func (*ConstService) Name ¶
func (s *ConstService) Name(ctx context.Context, in *cores.ConstNameRequest) (*pb.Const, error)
func (*ConstService) Pull ¶
func (s *ConstService) Pull(ctx context.Context, in *cores.ConstPullRequest) (*cores.ConstPullResponse, error)
func (*ConstService) SetValue ¶
func (s *ConstService) SetValue(ctx context.Context, in *pb.ConstValue) (*pb.MyBool, error)
func (*ConstService) SetValueByName ¶
func (s *ConstService) SetValueByName(ctx context.Context, in *cores.ConstNameValue) (*pb.MyBool, error)
func (*ConstService) SetValueByNameForce ¶
func (s *ConstService) SetValueByNameForce(ctx context.Context, in *cores.ConstNameValue) (*pb.MyBool, error)
func (*ConstService) SetValueForce ¶
func (s *ConstService) SetValueForce(ctx context.Context, in *pb.ConstValue) (*pb.MyBool, error)
func (*ConstService) ViewByDeviceIDAndName ¶
func (*ConstService) ViewFromCacheByDeviceIDAndName ¶
func (*ConstService) ViewFromCacheByID ¶
func (*ConstService) ViewWithDeleted ¶
type ControlService ¶
type ControlService struct { cores.UnimplementedControlServiceServer // contains filtered or unexported fields }
func (*ControlService) AddClient ¶
func (s *ControlService) AddClient(deviceID string, client cores.ControlServiceClient)
func (*ControlService) GetClient ¶
func (s *ControlService) GetClient(deviceID string) types.Option[cores.ControlServiceClient]
func (*ControlService) GetTagValue ¶
func (*ControlService) RemoveClient ¶
func (s *ControlService) RemoveClient(deviceID string, client cores.ControlServiceClient)
func (*ControlService) SetTagValue ¶
type CoreOption ¶
type CoreOption interface {
// contains filtered or unexported methods
}
func WithCache ¶
func WithCache(enable bool) CoreOption
func WithCacheGCTTL ¶
func WithCacheGCTTL(d time.Duration) CoreOption
func WithCacheTTL ¶
func WithCacheTTL(d time.Duration) CoreOption
func WithInfluxDB ¶
func WithInfluxDB(influxdb *db.InfluxDB) CoreOption
func WithLinkTTL ¶
func WithLinkTTL(d time.Duration) CoreOption
func WithLogger ¶
func WithLogger(logger *zap.Logger) CoreOption
func WithSave ¶
func WithSave(enable bool) CoreOption
func WithSaveInterval ¶
func WithSaveInterval(d time.Duration) CoreOption
type CoreService ¶
type CoreService struct {
// contains filtered or unexported fields
}
func Core ¶
func Core(db *bun.DB, opts ...CoreOption) (*CoreService, error)
func CoreContext ¶
func CoreContext(ctx context.Context, db *bun.DB, opts ...CoreOption) (*CoreService, error)
func (*CoreService) Context ¶
func (cs *CoreService) Context() context.Context
func (*CoreService) GetAttr ¶
func (cs *CoreService) GetAttr() *AttrService
func (*CoreService) GetAuth ¶
func (cs *CoreService) GetAuth() *AuthService
func (*CoreService) GetClass ¶
func (cs *CoreService) GetClass() *ClassService
func (*CoreService) GetConst ¶
func (cs *CoreService) GetConst() *ConstService
func (*CoreService) GetControl ¶
func (cs *CoreService) GetControl() *ControlService
func (*CoreService) GetDB ¶
func (cs *CoreService) GetDB() *bun.DB
func (*CoreService) GetData ¶
func (cs *CoreService) GetData() *DataService
func (*CoreService) GetDevice ¶
func (cs *CoreService) GetDevice() *DeviceService
func (*CoreService) GetFn ¶
func (cs *CoreService) GetFn() *FnService
func (*CoreService) GetInfluxDB ¶
func (cs *CoreService) GetInfluxDB() types.Option[*db.InfluxDB]
func (*CoreService) GetLogic ¶
func (cs *CoreService) GetLogic() *LogicService
func (*CoreService) GetSave ¶
func (cs *CoreService) GetSave() types.Option[*SaveService]
func (*CoreService) GetSlot ¶
func (cs *CoreService) GetSlot() *SlotService
func (*CoreService) GetSource ¶
func (cs *CoreService) GetSource() *SourceService
func (*CoreService) GetStatus ¶
func (cs *CoreService) GetStatus() *StatusService
func (*CoreService) GetSync ¶
func (cs *CoreService) GetSync() *SyncService
func (*CoreService) GetSyncGlobal ¶
func (cs *CoreService) GetSyncGlobal() *SyncGlobalService
func (*CoreService) GetTag ¶
func (cs *CoreService) GetTag() *TagService
func (*CoreService) GetUser ¶
func (cs *CoreService) GetUser() *UserService
func (*CoreService) Logger ¶
func (cs *CoreService) Logger() *zap.Logger
func (*CoreService) Register ¶
func (cs *CoreService) Register(server *grpc.Server)
func (*CoreService) Start ¶
func (cs *CoreService) Start()
func (*CoreService) Stop ¶
func (cs *CoreService) Stop()
type DataService ¶
type DataService struct { cores.UnimplementedDataServiceServer // contains filtered or unexported fields }
func (*DataService) CheckDataTypeJson ¶
func (s *DataService) CheckDataTypeJson(tag *model.Tag, value any) (nson.Value, error)
func (*DataService) CheckDataTypeNson ¶
func (s *DataService) CheckDataTypeNson(tag *model.Tag, value nson.Value) error
func (*DataService) Compile ¶
func (s *DataService) Compile(ctx context.Context, in *cores.DataQueryRequest) (*pb.Message, error)
func (*DataService) Query ¶
func (s *DataService) Query(in *cores.DataQueryRequest, stream cores.DataService_QueryServer) error
func (*DataService) QueryById ¶
func (s *DataService) QueryById(in *cores.DataQueryByIdRequest, stream cores.DataService_QueryByIdServer) error
func (*DataService) SetValue ¶
func (s *DataService) SetValue(tagID string, value nson.Value)
func (*DataService) UpdateValue ¶
func (s *DataService) UpdateValue(tag *model.Tag, value nson.Value)
func (*DataService) Upload ¶
func (s *DataService) Upload(ctx context.Context, in *cores.DataUploadRequest) (*cores.DataUploadResponse, error)
type DeviceService ¶
type DeviceService struct { cores.UnimplementedDeviceServiceServer // contains filtered or unexported fields }
func (*DeviceService) GC ¶
func (s *DeviceService) GC()
func (*DeviceService) Link ¶
func (s *DeviceService) Link(ctx context.Context, in *cores.DeviceLinkRequest) (*pb.MyBool, error)
func (*DeviceService) List ¶
func (s *DeviceService) List(ctx context.Context, in *cores.DeviceListRequest) (*cores.DeviceListResponse, error)
func (*DeviceService) Pull ¶
func (s *DeviceService) Pull(ctx context.Context, in *cores.DevicePullRequest) (*cores.DevicePullResponse, error)
func (*DeviceService) ViewByName ¶
func (*DeviceService) ViewFromCacheByID ¶
func (*DeviceService) ViewFromCacheByName ¶
func (*DeviceService) ViewWithDeleted ¶
type FnService ¶
type FnService struct { cores.UnimplementedFnServiceServer // contains filtered or unexported fields }
func (*FnService) List ¶
func (s *FnService) List(ctx context.Context, in *cores.FnListRequest) (*cores.FnListResponse, error)
func (*FnService) Pull ¶
func (s *FnService) Pull(ctx context.Context, in *cores.FnPullRequest) (*cores.FnPullResponse, error)
type GlobalNotify ¶
type GlobalNotify struct {
// contains filtered or unexported fields
}
func (*GlobalNotify) Close ¶
func (n *GlobalNotify) Close()
func (*GlobalNotify) Id ¶
func (n *GlobalNotify) Id() string
func (*GlobalNotify) Wait ¶
func (w *GlobalNotify) Wait() <-chan struct{}
type LogicService ¶
type LogicService struct { cores.UnimplementedLogicServiceServer // contains filtered or unexported fields }
func (*LogicService) Clone ¶
func (s *LogicService) Clone(ctx context.Context, in *cores.LogicCloneRequest) (*pb.MyBool, error)
func (*LogicService) List ¶
func (s *LogicService) List(ctx context.Context, in *cores.LogicListRequest) (*cores.LogicListResponse, error)
func (*LogicService) Name ¶
func (s *LogicService) Name(ctx context.Context, in *cores.LogicNameRequest) (*pb.Logic, error)
func (*LogicService) Pull ¶
func (s *LogicService) Pull(ctx context.Context, in *cores.LogicPullRequest) (*cores.LogicPullResponse, error)
func (*LogicService) ViewWithDeleted ¶
type SaveService ¶
type SaveService struct {
// contains filtered or unexported fields
}
type SlotService ¶
type SlotService struct { cores.UnimplementedSlotServiceServer // contains filtered or unexported fields }
func (*SlotService) Clone ¶
func (s *SlotService) Clone(ctx context.Context, in *cores.SlotCloneRequest) (*pb.MyBool, error)
func (*SlotService) Link ¶
func (s *SlotService) Link(ctx context.Context, in *cores.SlotLinkRequest) (*pb.MyBool, error)
func (*SlotService) List ¶
func (s *SlotService) List(ctx context.Context, in *cores.SlotListRequest) (*cores.SlotListResponse, error)
func (*SlotService) Name ¶
func (s *SlotService) Name(ctx context.Context, in *cores.SlotNameRequest) (*pb.Slot, error)
func (*SlotService) Pull ¶
func (s *SlotService) Pull(ctx context.Context, in *cores.SlotPullRequest) (*cores.SlotPullResponse, error)
func (*SlotService) ViewByDeviceIDAndName ¶
func (*SlotService) ViewWithDeleted ¶
type SourceService ¶
type SourceService struct { cores.UnimplementedSourceServiceServer // contains filtered or unexported fields }
func (*SourceService) Clone ¶
func (s *SourceService) Clone(ctx context.Context, in *cores.SourceCloneRequest) (*pb.MyBool, error)
func (*SourceService) GC ¶
func (s *SourceService) GC()
func (*SourceService) Link ¶
func (s *SourceService) Link(ctx context.Context, in *cores.SourceLinkRequest) (*pb.MyBool, error)
func (*SourceService) List ¶
func (s *SourceService) List(ctx context.Context, in *cores.SourceListRequest) (*cores.SourceListResponse, error)
func (*SourceService) Name ¶
func (s *SourceService) Name(ctx context.Context, in *cores.SourceNameRequest) (*pb.Source, error)
func (*SourceService) Pull ¶
func (s *SourceService) Pull(ctx context.Context, in *cores.SourcePullRequest) (*cores.SourcePullResponse, error)
func (*SourceService) ViewByDeviceIDAndName ¶
func (*SourceService) ViewFromCacheByDeviceIDAndName ¶
func (*SourceService) ViewFromCacheByID ¶
func (*SourceService) ViewWithDeleted ¶
type StatusService ¶
type StatusService struct {
// contains filtered or unexported fields
}
func (*StatusService) GetLink ¶
func (s *StatusService) GetLink(key string) int32
func (*StatusService) GetLinkValue ¶
func (*StatusService) SetLink ¶
func (s *StatusService) SetLink(key string, status int32)
type SyncGlobalService ¶
type SyncGlobalService struct { cores.UnimplementedSyncGlobalServiceServer // contains filtered or unexported fields }
func (*SyncGlobalService) GetUpdated ¶
func (s *SyncGlobalService) GetUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
func (*SyncGlobalService) Notify ¶
func (s *SyncGlobalService) Notify(id string) *GlobalNotify
func (*SyncGlobalService) SetUpdated ¶
func (s *SyncGlobalService) SetUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
func (*SyncGlobalService) WaitDeviceUpdated ¶
func (s *SyncGlobalService) WaitDeviceUpdated(in *pb.Id, stream cores.SyncGlobalService_WaitUpdatedServer) error
type SyncService ¶
type SyncService struct { cores.UnimplementedSyncServiceServer // contains filtered or unexported fields }
func (*SyncService) GetDeviceUpdated ¶
func (s *SyncService) GetDeviceUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
func (*SyncService) GetTagValueUpdated ¶
func (s *SyncService) GetTagValueUpdated(ctx context.Context, in *pb.Id) (*cores.SyncUpdated, error)
func (*SyncService) Notify ¶
func (s *SyncService) Notify(id string, nt NotifyType) *Notify
func (*SyncService) SetDeviceUpdated ¶
func (s *SyncService) SetDeviceUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
func (*SyncService) SetTagValueUpdated ¶
func (s *SyncService) SetTagValueUpdated(ctx context.Context, in *cores.SyncUpdated) (*pb.MyBool, error)
func (*SyncService) WaitDeviceUpdated ¶
func (s *SyncService) WaitDeviceUpdated(in *pb.Id, stream cores.SyncService_WaitDeviceUpdatedServer) error
func (*SyncService) WaitTagValueUpdated ¶
func (s *SyncService) WaitTagValueUpdated(in *pb.Id, stream cores.SyncService_WaitTagValueUpdatedServer) error
type TagService ¶
type TagService struct { cores.UnimplementedTagServiceServer // contains filtered or unexported fields }
func (*TagService) Clone ¶
func (s *TagService) Clone(ctx context.Context, in *cores.TagCloneRequest) (*pb.MyBool, error)
func (*TagService) DeleteValue ¶
func (*TagService) GC ¶
func (s *TagService) GC()
func (*TagService) GetValueByName ¶
func (s *TagService) GetValueByName(ctx context.Context, in *cores.TagGetValueByNameRequest) (*cores.TagNameValue, error)
func (*TagService) List ¶
func (s *TagService) List(ctx context.Context, in *cores.TagListRequest) (*cores.TagListResponse, error)
func (*TagService) Name ¶
func (s *TagService) Name(ctx context.Context, in *cores.TagNameRequest) (*pb.Tag, error)
func (*TagService) Pull ¶
func (s *TagService) Pull(ctx context.Context, in *cores.TagPullRequest) (*cores.TagPullResponse, error)
func (*TagService) PullValue ¶
func (s *TagService) PullValue(ctx context.Context, in *cores.TagPullValueRequest) (*cores.TagPullValueResponse, error)
func (*TagService) SetValueByName ¶
func (s *TagService) SetValueByName(ctx context.Context, in *cores.TagNameValue) (*pb.MyBool, error)
func (*TagService) SetValueByNameForce ¶
func (s *TagService) SetValueByNameForce(ctx context.Context, in *cores.TagNameValue) (*pb.MyBool, error)
func (*TagService) SetValueForce ¶
func (*TagService) ViewByDeviceIDAndName ¶
func (*TagService) ViewBySourceIDAndAddress ¶
func (*TagService) ViewBySourceIDAndName ¶
func (*TagService) ViewFromCacheByDeviceIDAndName ¶
func (*TagService) ViewFromCacheByID ¶
func (*TagService) ViewFromCacheBySourceIDAndAddress ¶
func (*TagService) ViewFromCacheBySourceIDAndName ¶
func (*TagService) ViewValue ¶
func (s *TagService) ViewValue(ctx context.Context, in *pb.Id) (*pb.TagValueUpdated, error)
func (*TagService) ViewWithDeleted ¶
type UserService ¶
type UserService struct { cores.UnimplementedUserServiceServer // contains filtered or unexported fields }
func (*UserService) GC ¶
func (s *UserService) GC()
func (*UserService) List ¶
func (s *UserService) List(ctx context.Context, in *cores.UserListRequest) (*cores.UserListResponse, error)
func (*UserService) Pull ¶
func (s *UserService) Pull(ctx context.Context, in *cores.UserPullRequest) (*cores.UserPullResponse, error)
func (*UserService) ViewByName ¶
func (*UserService) ViewFromCacheByID ¶
func (*UserService) ViewFromCacheByName ¶
func (*UserService) ViewWithDeleted ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.