Documentation ¶
Index ¶
- Constants
- Variables
- func AddDeviceSwitchResources(ctx context.Context, t *testing.T, deviceID string, c pb.GrpcGatewayClient, ...) []schema.ResourceLink
- func AssertToCheckFunc(...) func(t *testing.T, expected interface{}, actual interface{}, ...)
- func CheckProtobufs(t *testing.T, expected interface{}, actual interface{}, ...)
- func CleanUpResourcesArray(resources []*commands.Resource) []*commands.Resource
- func DecodeCbor(t *testing.T, data []byte) interface{}
- func DefaultSwitchResourceLink(deviceID, id string) schema.ResourceLink
- func DeviceIsBatchObservable(ctx context.Context, t *testing.T, deviceID string) bool
- func EncodeToCbor(t *testing.T, v interface{}) []byte
- func EncodeToSortedCbor(v interface{}) ([]byte, error)
- func FieldJsonTag(v interface{}, fieldName string) string
- func FilterResourceLink(filter func(schema.ResourceLink) bool, links []schema.ResourceLink) []schema.ResourceLink
- func GenerateDeviceIDbyIdx(deviceIndex int) string
- func GenerateIDbyIdx(prefix string, deviceIndex int) string
- func GetAllBackendResourceLinks() schema.ResourceLinks
- func GetDeviceResourceRepresentation(deviceID, deviceName string) schemaDevice.Device
- func GetIotivityLiteVersion(t *testing.T, deviceID string) uint32
- func GetResource(ctx context.Context, deviceID, resourceURI, resourceType string, ...) error
- func GetRootCertificateAuthorities(t *testing.T) []*x509.Certificate
- func GetRootCertificatePool(t *testing.T) *x509.CertPool
- func IsDiscoveryResourceBatchObservable(ctx context.Context, t *testing.T, deviceID string) bool
- func IsListenSocketClosed(t require.TestingT, target string, addStr string) bool
- func MakeSwitchResourceData(overrides map[string]interface{}) map[string]interface{}
- func MakeSwitchResourceDefaultData() map[string]interface{}
- func MustFindDeviceByName(name string) (deviceID string)
- func MustFindTestDevice() device.Device
- func MustGetHostname() string
- func NATSSStart(ctx context.Context, t *testing.T)
- func NATSSStop(ctx context.Context, t *testing.T)
- func OffBoardDevSim(ctx context.Context, t *testing.T, deviceID string)
- func OffboardDevice(ctx context.Context, t *testing.T, d device.Device)
- func OnboardDevSim(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, ...) (string, func())
- func OnboardDevSimForClient(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, ...) (string, func())
- func OnboardDevice(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, d device.Device, ...) func()
- func OnboardDeviceForClient(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, d device.Device, ...) func()
- func ProtobufToInterface(t *testing.T, val interface{}) interface{}
- func RequireToCheckFunc(...) func(t *testing.T, expected interface{}, actual interface{}, ...)
- func ResourceLinksToResourceIds(deviceID string, s []schema.ResourceLink) []*commands.ResourceId
- func ResourceLinksToResources(deviceID string, s []schema.ResourceLink) []*commands.Resource
- func ResourceLinksToResources2(deviceID string, s []schema.ResourceLink) []*pb.Resource
- func SortResources(s commands.Resources) commands.Resources
- func StringToApplicationProtocol(p string) commands.Connection_Protocol
- func TestResourceLightInstanceHref(id string) string
- func TestResourceSwitchesInstanceHref(id string) string
- func WaitForDevice(t *testing.T, client pb.GrpcGateway_SubscribeToEventsClient, ...)
- type CollectionLinkRepresentation
- type CollectionLinkRepresentations
- type LightResourceRepresentation
- type MaintenanceResourceRepresentation
- type PlgdTimeResourceRepresentation
- type ResourceLinkRepresentation
- type ResourceLinkRepresentations
- type SwitchResourceRepresentation
Constants ¶
View Source
const (
TestResourceSwitchesHref = "/switches"
)
Variables ¶
View Source
var ( TestDeviceName string TestDeviceNameWithOicResObservable string TestDeviceModelNumber = "CS-0" TestDeviceSoftwareVersion = "1.0.1-rc1" TestDeviceType device.Type )
Functions ¶
func AddDeviceSwitchResources ¶
func AddDeviceSwitchResources(ctx context.Context, t *testing.T, deviceID string, c pb.GrpcGatewayClient, resourceIDs ...string) []schema.ResourceLink
func AssertToCheckFunc ¶
func CheckProtobufs ¶
func CleanUpResourcesArray ¶
func DecodeCbor ¶
func DefaultSwitchResourceLink ¶
func DefaultSwitchResourceLink(deviceID, id string) schema.ResourceLink
func DeviceIsBatchObservable ¶ added in v2.13.1
func EncodeToCbor ¶
func EncodeToSortedCbor ¶ added in v2.16.0
func FieldJsonTag ¶
Get json tag of field with given name in struct v
func FilterResourceLink ¶
func FilterResourceLink(filter func(schema.ResourceLink) bool, links []schema.ResourceLink) []schema.ResourceLink
func GenerateDeviceIDbyIdx ¶ added in v2.16.0
func GenerateIDbyIdx ¶ added in v2.16.0
func GetAllBackendResourceLinks ¶
func GetAllBackendResourceLinks() schema.ResourceLinks
func GetDeviceResourceRepresentation ¶ added in v2.7.16
func GetDeviceResourceRepresentation(deviceID, deviceName string) schemaDevice.Device
func GetIotivityLiteVersion ¶ added in v2.13.1
func GetResource ¶ added in v2.13.1
func GetRootCertificateAuthorities ¶
func GetRootCertificateAuthorities(t *testing.T) []*x509.Certificate
func IsDiscoveryResourceBatchObservable ¶ added in v2.3.7
func IsListenSocketClosed ¶ added in v2.16.1
func MakeSwitchResourceData ¶
func MakeSwitchResourceDefaultData ¶
func MakeSwitchResourceDefaultData() map[string]interface{}
func MustFindDeviceByName ¶
func MustFindTestDevice ¶ added in v2.16.4
func MustGetHostname ¶
func MustGetHostname() string
func OffBoardDevSim ¶ added in v2.7.8
func OffboardDevice ¶ added in v2.16.4
func OnboardDevSim ¶
func OnboardDevSim(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, deviceID, hubEndpoint string, expectedResources []schema.ResourceLink) (string, func())
func OnboardDevSimForClient ¶
func OnboardDevSimForClient(ctx context.Context, t *testing.T, c pb.GrpcGatewayClient, clientID, deviceID, hubEndpoint string, expectedResources []schema.ResourceLink) (string, func())
func OnboardDevice ¶ added in v2.16.4
func OnboardDeviceForClient ¶ added in v2.16.4
func ProtobufToInterface ¶
func RequireToCheckFunc ¶
func ResourceLinksToResourceIds ¶
func ResourceLinksToResourceIds(deviceID string, s []schema.ResourceLink) []*commands.ResourceId
func ResourceLinksToResources ¶
func ResourceLinksToResources(deviceID string, s []schema.ResourceLink) []*commands.Resource
func ResourceLinksToResources2 ¶
func ResourceLinksToResources2(deviceID string, s []schema.ResourceLink) []*pb.Resource
func StringToApplicationProtocol ¶ added in v2.7.0
func StringToApplicationProtocol(p string) commands.Connection_Protocol
func WaitForDevice ¶ added in v2.3.1
func WaitForDevice(t *testing.T, client pb.GrpcGateway_SubscribeToEventsClient, deviceID, subID, correlationID string, expectedResources []schema.ResourceLink)
Types ¶
type CollectionLinkRepresentation ¶ added in v2.13.1
type CollectionLinkRepresentation struct { Href string `json:"href"` Representation interface{} `json:"rep"` }
type CollectionLinkRepresentations ¶ added in v2.13.1
type CollectionLinkRepresentations []CollectionLinkRepresentation
type LightResourceRepresentation ¶ added in v2.7.16
type MaintenanceResourceRepresentation ¶ added in v2.7.16
type MaintenanceResourceRepresentation struct {
FactoryReset bool `json:"fr"`
}
type PlgdTimeResourceRepresentation ¶ added in v2.7.16
type ResourceLinkRepresentation ¶ added in v2.7.16
type ResourceLinkRepresentation struct { Href string /*`json:"href"`*/ Representation interface{} /*`json:"rep"`*/ }
func (*ResourceLinkRepresentation) MarshalJSON ¶ added in v2.7.16
func (d *ResourceLinkRepresentation) MarshalJSON() ([]byte, error)
func (*ResourceLinkRepresentation) UnmarshalJSON ¶ added in v2.7.16
func (d *ResourceLinkRepresentation) UnmarshalJSON(data []byte) error
type ResourceLinkRepresentations ¶ added in v2.7.16
type ResourceLinkRepresentations []ResourceLinkRepresentation
func GetAllBackendResourceRepresentations ¶ added in v2.7.16
func GetAllBackendResourceRepresentations(t *testing.T, deviceID, deviceName string) ResourceLinkRepresentations
func (ResourceLinkRepresentations) Sort ¶ added in v2.7.16
func (r ResourceLinkRepresentations) Sort() ResourceLinkRepresentations
type SwitchResourceRepresentation ¶ added in v2.7.16
type SwitchResourceRepresentation struct {
Value bool `json:"value"`
}
Click to show internal directories.
Click to hide internal directories.