helper

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 21 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, searchurl 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, searchurl 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, searchurl string, selectionurl string, err error)

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