mocks

package
v0.0.23 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mongo

func Mongo(ctx context.Context, wg *sync.WaitGroup) (mongoUrl string, err error)

Types

type Database

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

func NewDatabase

func NewDatabase() *Database

func (*Database) Disconnect

func (this *Database) Disconnect()

func (*Database) GetAspect

func (this *Database) GetAspect(ctx context.Context, id string) (result models.Aspect, exists bool, err error)

func (*Database) GetCharacteristic

func (this *Database) GetCharacteristic(ctx context.Context, id string) (result models.Characteristic, exists bool, err error)

func (*Database) GetConceptWithCharacteristics

func (this *Database) GetConceptWithCharacteristics(ctx context.Context, id string) (result models.ConceptWithCharacteristics, exists bool, err error)

func (*Database) GetConceptWithoutCharacteristics

func (this *Database) GetConceptWithoutCharacteristics(ctx context.Context, id string) (result models.Concept, exists bool, err error)

func (*Database) GetDevice

func (this *Database) GetDevice(ctx context.Context, id string) (device models.Device, exists bool, err error)

func (*Database) GetDeviceByLocalId

func (this *Database) GetDeviceByLocalId(ctx context.Context, localId string) (device models.Device, exists bool, err error)

func (*Database) GetDeviceClass

func (this *Database) GetDeviceClass(ctx context.Context, id string) (result models.DeviceClass, exists bool, err error)

func (*Database) GetDeviceGroup

func (this *Database) GetDeviceGroup(ctx context.Context, id string) (deviceGroup models.DeviceGroup, exists bool, err error)

func (*Database) GetDeviceType

func (this *Database) GetDeviceType(ctx context.Context, id string) (deviceType models.DeviceType, exists bool, err error)

func (*Database) GetDeviceTypesByServiceId

func (this *Database) GetDeviceTypesByServiceId(ctx context.Context, serviceId string) ([]models.DeviceType, error)

func (*Database) GetFunction

func (this *Database) GetFunction(ctx context.Context, id string) (result models.Function, exists bool, err error)

func (*Database) GetHub

func (this *Database) GetHub(ctx context.Context, id string) (hub models.Hub, exists bool, err error)

func (*Database) GetHubsByDeviceId added in v0.0.20

func (this *Database) GetHubsByDeviceId(ctx context.Context, id string) (hubs []models.Hub, err error)

func (*Database) GetLocation

func (this *Database) GetLocation(ctx context.Context, id string) (result models.Location, exists bool, err error)

func (*Database) GetProtocol

func (this *Database) GetProtocol(ctx context.Context, id string) (result models.Protocol, exists bool, err error)

func (*Database) ListAllAspects

func (this *Database) ListAllAspects(ctx context.Context) ([]models.Aspect, error)

func (*Database) ListAllCharacteristics

func (this *Database) ListAllCharacteristics(ctx context.Context) ([]models.Characteristic, error)

func (*Database) ListAllControllingFunctionsByDeviceClass

func (this *Database) ListAllControllingFunctionsByDeviceClass(ctx context.Context, class string) ([]models.Function, error)

func (*Database) ListAllDeviceClasses

func (this *Database) ListAllDeviceClasses(ctx context.Context) ([]models.DeviceClass, error)

func (*Database) ListAllDeviceClassesUsedWithControllingFunctions

func (this *Database) ListAllDeviceClassesUsedWithControllingFunctions(ctx context.Context) ([]models.DeviceClass, error)

func (*Database) ListAllFunctionsByDeviceClass

func (this *Database) ListAllFunctionsByDeviceClass(ctx context.Context, class string) ([]models.Function, error)

func (*Database) ListAllFunctionsByType

func (this *Database) ListAllFunctionsByType(ctx context.Context, rdfType string) ([]models.Function, error)

func (*Database) ListAllMeasuringFunctionsByAspect

func (this *Database) ListAllMeasuringFunctionsByAspect(ctx context.Context, aspect string) ([]models.Function, error)

func (*Database) ListAspectsWithMeasuringFunction

func (this *Database) ListAspectsWithMeasuringFunction(ctx context.Context) ([]models.Aspect, error)

func (*Database) ListDeviceGroups

func (this *Database) ListDeviceGroups(ctx context.Context, limit int64, offset int64, sort string) (result []models.DeviceGroup, err error)

func (*Database) ListDeviceTypes

func (this *Database) ListDeviceTypes(ctx context.Context, limit int64, offset int64, sort string, filter []model.FilterCriteria) (result []models.DeviceType, err error)

func (*Database) ListFunctions

func (this *Database) ListFunctions(ctx context.Context, limit int, offset int, search string, direction string) (result []models.Function, count int, err error)

func (*Database) ListProtocols

func (this *Database) ListProtocols(ctx context.Context, limit int64, offset int64, sort string) ([]models.Protocol, error)

func (*Database) RemoveAspect

func (this *Database) RemoveAspect(ctx context.Context, id string) error

func (*Database) RemoveCharacteristic

func (this *Database) RemoveCharacteristic(ctx context.Context, id string) error

func (*Database) RemoveConcept

func (this *Database) RemoveConcept(ctx context.Context, id string) error

func (*Database) RemoveDevice

func (this *Database) RemoveDevice(ctx context.Context, id string) error

func (*Database) RemoveDeviceClass

func (this *Database) RemoveDeviceClass(ctx context.Context, id string) error

func (*Database) RemoveDeviceGroup

func (this *Database) RemoveDeviceGroup(ctx context.Context, id string) error

func (*Database) RemoveDeviceType

func (this *Database) RemoveDeviceType(ctx context.Context, id string) error

func (*Database) RemoveFunction

func (this *Database) RemoveFunction(ctx context.Context, id string) error

func (*Database) RemoveHub

func (this *Database) RemoveHub(ctx context.Context, id string) error

func (*Database) RemoveLocation

func (this *Database) RemoveLocation(ctx context.Context, id string) error

func (*Database) RemoveProtocol

func (this *Database) RemoveProtocol(ctx context.Context, id string) error

func (*Database) SetAspect

func (this *Database) SetAspect(ctx context.Context, aspect models.Aspect) error

func (*Database) SetCharacteristic

func (this *Database) SetCharacteristic(ctx context.Context, characteristic models.Characteristic) error

func (*Database) SetConcept

func (this *Database) SetConcept(ctx context.Context, concept models.Concept) error

func (*Database) SetDevice

func (this *Database) SetDevice(ctx context.Context, device models.Device) error

func (*Database) SetDeviceClass

func (this *Database) SetDeviceClass(ctx context.Context, class models.DeviceClass) error

func (*Database) SetDeviceGroup

func (this *Database) SetDeviceGroup(ctx context.Context, deviceGroup models.DeviceGroup) error

func (*Database) SetDeviceType

func (this *Database) SetDeviceType(ctx context.Context, deviceType models.DeviceType) error

func (*Database) SetFunction

func (this *Database) SetFunction(ctx context.Context, function models.Function) error

func (*Database) SetHub

func (this *Database) SetHub(ctx context.Context, hub models.Hub) error

func (*Database) SetLocation

func (this *Database) SetLocation(ctx context.Context, location models.Location) error

func (*Database) SetProtocol

func (this *Database) SetProtocol(ctx context.Context, protocol models.Protocol) error

type Security

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

func NewSecurity

func NewSecurity() *Security

func (*Security) CheckBool

func (this *Security) CheckBool(token string, kind string, id string, action model.AuthAction) (allowed bool, err error)

func (*Security) CheckMultiple

func (this *Security) CheckMultiple(token string, kind string, ids []string, action model.AuthAction) (map[string]bool, error)

func (*Security) GetAdminUsers added in v0.0.19

func (this *Security) GetAdminUsers(token string, kind string, id string) (admins []string, err error)

func (*Security) ListAccessibleResourceIds added in v0.0.20

func (this *Security) ListAccessibleResourceIds(token string, topic string, limit int64, offset int64, action model.AuthAction) (result []string, err error)

func (*Security) Set

func (this *Security) Set(kind string, id string, access bool)

func (*Security) SetAdmins added in v0.0.19

func (this *Security) SetAdmins(kind string, id string, admins []string)

Jump to

Keyboard shortcuts

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