iot

package
v0.0.0-...-a19f7d7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func (*Cache) CreateDevice

func (this *Cache) CreateDevice(device model.Device) (result model.Device, err error)

func (*Cache) EnsureLocalDeviceExistence

func (this *Cache) EnsureLocalDeviceExistence(device model.Device) (result model.Device, err error)

func (*Cache) GetDevice

func (this *Cache) GetDevice(id string) (result model.Device, err error)

func (*Cache) GetDeviceByLocalId

func (this *Cache) GetDeviceByLocalId(deviceUrl string) (result model.Device, err error)

func (*Cache) GetDeviceType

func (this *Cache) GetDeviceType(id string) (result model.DeviceType, err error)

func (*Cache) GetProtocol

func (this *Cache) GetProtocol(id string) (result model.Protocol, err error)

type Iot

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

func New

func New(deviceManagerUrl string, deviceRepoUrl string, permv2Url string) *Iot

func (*Iot) CreateDevice

func (this *Iot) CreateDevice(device model.Device, token security.JwtToken) (result model.Device, err error)

func (*Iot) CreateDeviceType

func (this *Iot) CreateDeviceType(deviceType model.DeviceType, token security.JwtToken) (dt model.DeviceType, err error)

func (*Iot) CreateHub

func (this *Iot) CreateHub(hub model.Hub, cred security.JwtToken) (result model.Hub, err error)

func (*Iot) CreateHubWithFixedId

func (this *Iot) CreateHubWithFixedId(hub model.Hub, adminToken security.JwtToken, userId string) (result model.Hub, err error)

func (*Iot) DeleteHub

func (this *Iot) DeleteHub(id string, cred security.JwtToken) (err error)

func (*Iot) ExistsHub

func (this *Iot) ExistsHub(id string, cred security.JwtToken) (exists bool, err error)

func (*Iot) FindDeviceTypesWithAttributes

func (this *Iot) FindDeviceTypesWithAttributes(attributes []model.Attribute, token security.JwtToken) (dt []model.DeviceType, err error)

func (*Iot) GetCharacteristicById

func (this *Iot) GetCharacteristicById(id string, token security.JwtToken) (characteristic model.Characteristic, err error)

func (*Iot) GetDevice

func (this *Iot) GetDevice(id string, token security.JwtToken) (device model.Device, err error)

func (*Iot) GetDeviceByLocalId

func (this *Iot) GetDeviceByLocalId(localId string, token security.JwtToken) (device model.Device, err error)

func (*Iot) GetDeviceType

func (this *Iot) GetDeviceType(id string, token security.JwtToken) (dt model.DeviceType, err error)

func (*Iot) GetDeviceUserRights

func (this *Iot) GetDeviceUserRights(token security.JwtToken, deviceId string) (rights model.ResourceRights, err error)

func (*Iot) GetHub

func (this *Iot) GetHub(id string, cred security.JwtToken, optionals ...options.Option) (hub model.Hub, err error)

func (*Iot) GetHubsByDeviceLocalId

func (this *Iot) GetHubsByDeviceLocalId(localId string, token security.JwtToken) (hubs []model.Hub, err error)

func (*Iot) GetProtocol

func (this *Iot) GetProtocol(id string, token security.JwtToken) (protocol model.Protocol, err error)

func (*Iot) UpdateDevice

func (this *Iot) UpdateDevice(device model.Device, token security.JwtToken) (result model.Device, err error)

func (*Iot) UpdateDeviceType

func (this *Iot) UpdateDeviceType(deviceType model.DeviceType, token security.JwtToken) (dt model.DeviceType, err error)

func (*Iot) UpdateHub

func (this *Iot) UpdateHub(id string, hub model.Hub, cred security.JwtToken) (result model.Hub, err error)

type PreparedCache

type PreparedCache struct {
	Debug bool
	// contains filtered or unexported fields
}

func NewCache

func NewCache(iot *Iot, deviceExpiration int32, deviceTypeExpiration int32, characteristicExpiration int32, maxIdleConns int, timeout time.Duration, memcachedServer ...string) (*PreparedCache, error)

func (*PreparedCache) CreateDevice

func (this *PreparedCache) CreateDevice(token security.JwtToken, device model.Device) (result model.Device, err error)

func (*PreparedCache) CreateDeviceType

func (this *PreparedCache) CreateDeviceType(token security.JwtToken, deviceType model.DeviceType) (result model.DeviceType, err error)

func (*PreparedCache) EnsureLocalDeviceExistence

func (this *PreparedCache) EnsureLocalDeviceExistence(token security.JwtToken, device model.Device) (result model.Device, err error)

func (*PreparedCache) GetCache

func (this *PreparedCache) GetCache() *cache.Cache

func (*PreparedCache) GetCharacteristicById

func (this *PreparedCache) GetCharacteristicById(id string, token security.JwtToken) (characteristic model.Characteristic, err error)

func (*PreparedCache) GetDevice

func (this *PreparedCache) GetDevice(token security.JwtToken, id string) (result model.Device, err error)

func (*PreparedCache) GetDeviceByLocalId

func (this *PreparedCache) GetDeviceByLocalId(token security.JwtToken, deviceUrl string) (result model.Device, err error)

func (*PreparedCache) GetDeviceType

func (this *PreparedCache) GetDeviceType(token security.JwtToken, id string) (result model.DeviceType, err error)

func (*PreparedCache) GetProtocol

func (this *PreparedCache) GetProtocol(token security.JwtToken, id string) (result model.Protocol, err error)

func (*PreparedCache) InvalidateDeviceTypeCache

func (this *PreparedCache) InvalidateDeviceTypeCache(deviceTypeId string)

func (*PreparedCache) UpdateDevice

func (this *PreparedCache) UpdateDevice(token security.JwtToken, device model.Device) (result model.Device, err error)

func (*PreparedCache) UpdateDeviceType

func (this *PreparedCache) UpdateDeviceType(token security.JwtToken, deviceType model.DeviceType) (result model.DeviceType, err error)

func (*PreparedCache) WithToken

func (this *PreparedCache) WithToken(token security.JwtToken) *Cache

type ResourceRights

type ResourceRights struct {
	ResourceId  string                 `json:"resource_id"`
	Features    map[string]interface{} `json:"features"`
	UserRights  map[string]Right       `json:"user_rights"`
	GroupRights map[string]Right       `json:"group_rights"`
	Creator     string                 `json:"creator"`
}
type Right struct {
	Read         bool `json:"read"`
	Write        bool `json:"write"`
	Execute      bool `json:"execute"`
	Administrate bool `json:"administrate"`
}

Directories

Path Synopsis
mock
iot

Jump to

Keyboard shortcuts

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