com

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryEqualOperation             = client.QueryEqualOperation
	QueryUnequalOperation           = client.QueryUnequalOperation
	QueryAnyValueInFeatureOperation = client.QueryAnyValueInFeatureOperation
)
View Source
const Seperator = "$"

Variables

View Source
var ResourcesEffectedByUserDelete_BATCH_SIZE = 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) GetPermissions

func (this *Com) GetPermissions(token auth.Token, kind string, id string) (permmodel.ResourceRights, error)

func (*Com) GetProtocol

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

func (*Com) GetResourceOwner

func (this *Com) GetResourceOwner(token auth.Token, kind string, id string, rights string) (owner string, found bool, err error)

GetResourceOwner queries the permission-search service for the entity identified by kind and id and extracts its owner the rights parameter is a mandatory part of the permission-search api it is used to identify which rights the user (token) must have for the entity, to get the entity as a result for example, if a user has 'r' rights to an entity, the query will find the entity, if requested with rights="r" but not with rights="w" or rights="rw"

func (*Com) GetResourceRights added in v0.0.14

func (this *Com) GetResourceRights(token auth.Token, kind string, id string, rights string) (result permmodel.EntryResult, found bool, err error)

func (*Com) GetTechnicalDeviceGroup

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

func (*Com) ListDevices added in v0.0.16

func (this *Com) ListDevices(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) QueryPermissionsSearch

func (this *Com) QueryPermissionsSearch(token string, query QueryMessage, result interface{}) (err error, code int)

func (*Com) ResourcesEffectedByUserDelete

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

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)

type ConditionConfig

type ConditionConfig = client.ConditionConfig

type ListAfter

type ListAfter = client.ListAfter

type PermSearchElement

type PermSearchElement struct {
	Id                string            `json:"id"`
	Name              string            `json:"name"`
	Shared            bool              `json:"shared"`
	Creator           string            `json:"creator"`
	PermissionHolders PermissionHolders `json:"permission_holders"`
}

type PermissionHolders

type PermissionHolders struct {
	AdminUsers   []string `json:"admin_users"`
	ReadUsers    []string `json:"read_users"`
	WriteUsers   []string `json:"write_users"`
	ExecuteUsers []string `json:"execute_users"`
}

type QueryCheckIds

type QueryCheckIds = client.QueryCheckIds

type QueryFind

type QueryFind = client.QueryFind

type QueryListCommons

type QueryListCommons = client.QueryListCommons

type QueryListIds

type QueryListIds = client.QueryListIds

type QueryMessage

type QueryMessage = client.QueryMessage

type QueryOperationType

type QueryOperationType = client.QueryOperationType

type Selection

type Selection = client.Selection

Jump to

Keyboard shortcuts

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