helper

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const AdminJwt = "" /* 1949-byte string literal not displayed */
View Source
const JwtSubject = "dd69ea0d-f553-4336-80f3-7f4567f85c7b"

Variables

View Source
var SleepAfterEdit = 2 * time.Second

Functions

func EnvWithApi

func EnvWithApi(ctx context.Context, wg *sync.WaitGroup, deviceTypes []devicemodel.DeviceType, deviceInstances []devicemodel.Device) (managerurl string, repourl string, permv2Url string, selectionurl string, err error)

func EnvWithDevices

func EnvWithDevices(ctx context.Context, wg *sync.WaitGroup, deviceTypes []devicemodel.DeviceType, deviceInstances []devicemodel.Device) (kafkaUrl string, managerurl string, repourl string, permv2Url string, err error)

func EnvWithMetadata

func EnvWithMetadata(ctx context.Context, wg *sync.WaitGroup, deviceTypes []devicemodel.DeviceType, deviceInstances []devicemodel.Device, aspects []devicemodel.Aspect, functions []devicemodel.Function) (managerurl string, repourl string, permv2Url, selectionurl string, err error)

func ExpandExpectedAspectIds

func ExpandExpectedAspectIds(expected model.DeviceGroupHelperResult) model.DeviceGroupHelperResult

ExpandExpectedAspectIds fills AspectIds from the deprecated AspectId of an expected criteria. The fixtures are written with the alias, while a criteria of a result carries the list it stands for. This is applied to the expectation only, so that a result leaving AspectIds unset still fails.

func ExpandExpectedDeviceTypeSelectables

func ExpandExpectedDeviceTypeSelectables(selectables []devicemodel.DeviceTypeSelectable) []devicemodel.DeviceTypeSelectable

ExpandExpectedDeviceTypeSelectables expands the aspect aliases of expected device-type selectables, which carry the same services and path options without a device.

func ExpandExpectedSelectables

func ExpandExpectedSelectables(selectables []model.Selectable) []model.Selectable

ExpandExpectedSelectables expands the aspect aliases of expected selectables.

func GroupHelper

func GroupHelper(selectionurl string, maintainUsability bool, deviceIds []string, expectedResult model.DeviceGroupHelperResult) func(t *testing.T)

func IsZero

func IsZero(x interface{}) bool

func Jwtpost

func Jwtpost(token string, url string, msg interface{}) (resp *http.Response, err error)

func Jwtput

func Jwtput(token string, url string, msg interface{}) (resp *http.Response, err error)

func SetAspect

func SetAspect(devicemanagerUrl string, a devicemodel.Aspect) error

func SetConcept

func SetConcept(devicemanagerUrl string, c devicemodel.Concept) error

func SetDevice

func SetDevice(devicemanagerUrl string, d devicemodel.Device) error

func SetDeviceType

func SetDeviceType(devicemanagerUrl string, dt devicemodel.DeviceType) error

func SetFunction

func SetFunction(devicemanagerUrl string, f devicemodel.Function) error

func TestRequest

func TestRequest(serviceUrl string, method string, path string, body interface{}, expectedStatusCode int, expected interface{}) func(t *testing.T)

func TestRequestWithToken

func TestRequestWithToken(serviceUrl string, token string, method string, path string, body interface{}, expectedStatusCode int, expected interface{}) func(t *testing.T)

Types

type DeviceDescription

type DeviceDescription struct {
	CharacteristicId string                   `json:"characteristic_id"`
	Function         devicemodel.Function     `json:"function"`
	DeviceClass      *devicemodel.DeviceClass `json:"device_class,omitempty"`
	Aspect           *devicemodel.Aspect      `json:"aspect,omitempty"`
}

type DeviceDescriptions

type DeviceDescriptions []DeviceDescription

func (DeviceDescriptions) ToFilter

func (this DeviceDescriptions) ToFilter() (result model.FilterCriteriaAndSet)

type TestPermSearchDevice

type TestPermSearchDevice struct {
	Id          string            `json:"id"`
	LocalId     string            `json:"local_id,omitempty"`
	Name        string            `json:"name,omitempty"`
	DeviceType  string            `json:"device_type_id,omitempty"`
	Permissions model.Permissions `json:"permissions"`
	Shared      bool              `json:"shared"`
	Creator     string            `json:"creator"`
}

Jump to

Keyboard shortcuts

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