Documentation ¶
Index ¶
- func InitializeRegistry(c core.Config) error
- type Device
- type Product
- type Registry
- func (r *Registry) BulkDeleteDevice(devices []string) error
- func (r *Registry) BulkRegisterDevice(devices []Device) error
- func (r *Registry) BulkUpdateDevice(devices []Device) error
- func (r *Registry) CheckProductNameAvailable(p *Product) bool
- func (r *Registry) CheckTenantNameAvailable(t *Tenant) bool
- func (r *Registry) DeleteDevice(id string) error
- func (r *Registry) DeleteProduct(id string) error
- func (r *Registry) DeleteRule(id string) error
- func (r *Registry) DeleteTenant(t *Tenant) error
- func (r *Registry) GetDevice(id string) (*Device, error)
- func (r *Registry) GetProduct(id string) (*Product, error)
- func (r *Registry) GetProductDevices(id string) ([]Device, error)
- func (r *Registry) GetRule(id string) (*Rule, error)
- func (r *Registry) GetTenant(t *Tenant) error
- func (r *Registry) RegisterDevice(dev *Device) error
- func (r *Registry) RegisterProduct(p *Product) error
- func (r *Registry) RegisterRule(rule *Rule) error
- func (r *Registry) RegisterTenant(t *Tenant) error
- func (r *Registry) Release()
- func (r *Registry) UpdateDevice(dev *Device) error
- func (r *Registry) UpdateProduct(p *Product) error
- func (r *Registry) UpdateRule(rule *Rule) error
- type Rule
- type Tenant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeRegistry ¶
InitializeRegistry try to connect with background database to confirm wether it is normal
Types ¶
type Device ¶
type Device struct { Id string Name string ProductId string ProductKey string DeviceStatus string DeviceSecret string TimeCreated time.Time TimeModified time.Time }
Device
type Product ¶
type Product struct { Id string Name string Description string TimeCreated time.Time TimeModified time.Time CategoryId string }
Product
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is wraper of mongo database about for iot object
func NewRegistry ¶
NewRegistry create registry instance
func (*Registry) BulkDeleteDevice ¶
BulkDeleteDevice delete a lot of devices from registry
func (*Registry) BulkRegisterDevice ¶
BulkRegisterDevice add a lot of devices into registry
func (*Registry) BulkUpdateDevice ¶
BulkUpdateDevice update a lot of devices in registry
func (*Registry) CheckProductNameAvailable ¶
Product CheckProductNameAvailable check wethere product name is available
func (*Registry) CheckTenantNameAvailable ¶
CheckTenantNamveAvailable return true if name is available
func (*Registry) DeleteDevice ¶
DeleteDevice delete a device from registry
func (*Registry) DeleteProduct ¶
DeleteProduct delete a product from registry
func (*Registry) DeleteRule ¶
DeleteRule delete a rule from registry
func (*Registry) DeleteTenant ¶
func (*Registry) GetProduct ¶
GetProduct retrieve product detail information from registry
func (*Registry) GetProductDevices ¶
GetProductDevices get product's device list
func (*Registry) RegisterDevice ¶
RegisterDevice add a new device into registry
func (*Registry) RegisterProduct ¶
RegisterProduct register a product into registry
func (*Registry) RegisterRule ¶
RegisterRule add a new rule into registry
func (*Registry) RegisterTenant ¶
AddTenant insert a tenant into registry
func (*Registry) Release ¶
func (r *Registry) Release()
Release release registry rources and disconnect with background database
func (*Registry) UpdateDevice ¶
UpdateDevice update device information in registry
func (*Registry) UpdateProduct ¶
UpdateProduct update product detail information in registry
func (*Registry) UpdateRule ¶
UpdateRule update rule information in registry