com

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Seperator = "$"

Variables

View Source
var ResourcesEffectedByUserDelete_BATCH_SIZE int64 = 1000

Functions

func PreventIdModifier

func PreventIdModifier(id string) error

func RemoveDuplicates

func RemoveDuplicates[T comparable](slice []T) []T

Types

type Com

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

func New

func New(config config.Config) *Com

func (*Com) DeviceLocalIdToId

func (this *Com) DeviceLocalIdToId(token auth.Token, localId string) (id string, err error, code int)

func (*Com) DevicesOfTypeExist

func (this *Com) DevicesOfTypeExist(token auth.Token, deviceTypeId string) (result bool, err error, code int)

func (*Com) GetAspect

func (this *Com) GetAspect(token auth.Token, id string) (aspect models.Aspect, err error, code int)

func (*Com) GetCharacteristic

func (this *Com) GetCharacteristic(token auth.Token, id string) (concept models.Characteristic, err error, code int)

func (*Com) GetConcept

func (this *Com) GetConcept(token auth.Token, id string) (concept models.Concept, err error, code int)

func (*Com) GetDevice

func (this *Com) GetDevice(token auth.Token, id string) (device models.Device, err error, code int)

func (*Com) GetDeviceByLocalId added in v0.0.10

func (this *Com) GetDeviceByLocalId(token auth.Token, ownerId string, localid string) (device models.Device, err error, code int)

func (*Com) GetDeviceClass

func (this *Com) GetDeviceClass(token auth.Token, id string) (deviceClass models.DeviceClass, err error, code int)

func (*Com) GetDeviceType

func (this *Com) GetDeviceType(token auth.Token, id string) (dt models.DeviceType, err error, code int)

func (*Com) GetFunction

func (this *Com) GetFunction(token auth.Token, id string) (function models.Function, err error, code int)

func (*Com) GetHub

func (this *Com) GetHub(token auth.Token, id string) (hub models.Hub, err error, code int)

expects previous permission check and use own admin jwt to access hub

func (*Com) GetLocation

func (this *Com) GetLocation(token auth.Token, id string) (Location models.Location, err error, code int)

func (*Com) GetProtocol

func (this *Com) GetProtocol(token auth.Token, id string) (protocol models.Protocol, err error, code int)

func (*Com) GetResourceRights added in v0.0.14

func (this *Com) GetResourceRights(token auth.Token, kind string, id string) (result model.Resource, err error, code int)

func (*Com) GetTechnicalDeviceGroup

func (this *Com) GetTechnicalDeviceGroup(token auth.Token, id string) (dt models.DeviceGroup, err error, code int)

func (*Com) ListDeviceTypes added in v0.0.32

func (this *Com) ListDeviceTypes(token string, options devicerepo.DeviceTypeListOptions) (result []models.DeviceType, err error, code int)

func (*Com) ListDevices added in v0.0.16

func (this *Com) ListDevices(token string, options devicerepo.DeviceListOptions) (result []models.Device, err error, code int)

func (*Com) ListDevicesByQuery added in v0.0.32

func (this *Com) ListDevicesByQuery(token auth.Token, query url.Values) (devices []models.Device, err error, code int)

func (*Com) PermissionCheck

func (this *Com) PermissionCheck(token auth.Token, id string, permission string, resource string) (err error, code int)

func (*Com) PermissionCheckForCharacteristic

func (this *Com) PermissionCheckForCharacteristic(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForConcept

func (this *Com) PermissionCheckForConcept(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForDevice

func (this *Com) PermissionCheckForDevice(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForDeviceGroup

func (this *Com) PermissionCheckForDeviceGroup(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForDeviceList

func (this *Com) PermissionCheckForDeviceList(token auth.Token, ids []string, rights string) (result map[string]bool, err error, code int)

func (*Com) PermissionCheckForDeviceType

func (this *Com) PermissionCheckForDeviceType(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForHub

func (this *Com) PermissionCheckForHub(token auth.Token, id string, permission string) (err error, code int)

func (*Com) PermissionCheckForLocation

func (this *Com) PermissionCheckForLocation(token auth.Token, id string, permission string) (err error, code int)

func (*Com) ResourcesEffectedByUserDelete

func (this *Com) ResourcesEffectedByUserDelete(token auth.Token, resource string) (deleteResourceIds []string, deleteUserFromResource []client.Resource, err error)

func (*Com) SetPermission added in v0.0.32

func (this *Com) SetPermission(token string, topicId string, id string, permissions model.ResourcePermissions) (result model.ResourcePermissions, err error, code int)

func (*Com) ValidateAspect

func (this *Com) ValidateAspect(token auth.Token, aspect models.Aspect) (err error, code int)

func (*Com) ValidateAspectDelete

func (this *Com) ValidateAspectDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateCharacteristic

func (this *Com) ValidateCharacteristic(token auth.Token, characteristic models.Characteristic) (err error, code int)

func (*Com) ValidateCharacteristicDelete

func (this *Com) ValidateCharacteristicDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateConcept

func (this *Com) ValidateConcept(token auth.Token, concept models.Concept) (err error, code int)

func (*Com) ValidateConceptDelete

func (this *Com) ValidateConceptDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateDevice

func (this *Com) ValidateDevice(token auth.Token, device models.Device) (err error, code int)

func (*Com) ValidateDeviceClass

func (this *Com) ValidateDeviceClass(token auth.Token, deviceClass models.DeviceClass) (err error, code int)

func (*Com) ValidateDeviceClassDelete

func (this *Com) ValidateDeviceClassDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateDeviceGroup

func (this *Com) ValidateDeviceGroup(token auth.Token, dg models.DeviceGroup) (err error, code int)

func (*Com) ValidateDeviceGroupDelete added in v0.0.29

func (this *Com) ValidateDeviceGroupDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateDeviceType

func (this *Com) ValidateDeviceType(token auth.Token, dt models.DeviceType) (err error, code int)

func (*Com) ValidateFunction

func (this *Com) ValidateFunction(token auth.Token, function models.Function) (err error, code int)

func (*Com) ValidateFunctionDelete

func (this *Com) ValidateFunctionDelete(token auth.Token, id string) (err error, code int)

func (*Com) ValidateHub

func (this *Com) ValidateHub(token auth.Token, hub models.Hub) (err error, code int)

func (*Com) ValidateLocation

func (this *Com) ValidateLocation(token auth.Token, location models.Location) (err error, code int)

func (*Com) ValidateProtocol

func (this *Com) ValidateProtocol(token auth.Token, protocol models.Protocol) (err error, code int)

Jump to

Keyboard shortcuts

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