test

package
v2.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C2CURI

func C2CURI(uri string) string

func GetUniqueSubscriptionID

func GetUniqueSubscriptionID(subIDS ...string) string

func MakeConfig

func MakeConfig(t require.TestingT) service.Config

func MakeStorageConfig

func MakeStorageConfig() service.StorageConfig

func New

func New(t require.TestingT, cfg service.Config) func()

func NewTestListener

func NewTestListener(t *testing.T) (net.Listener, func())

func SetUp

func SetUp(t require.TestingT) (tearDown func())

Types

type C2CSubscriber

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

func NewC2CSubscriber

func NewC2CSubscriber(port, eventsURI string, subType SubscriptionType) *C2CSubscriber

func (*C2CSubscriber) Subscribe

func (c *C2CSubscriber) Subscribe(ctx context.Context, t *testing.T, token, deviceID, href string, eventTypes events.EventTypes) string

func (*C2CSubscriber) Unsubscribe

func (c *C2CSubscriber) Unsubscribe(ctx context.Context, t *testing.T, token, deviceID, href, subID string)

type Event

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

func WaitForEvents

func WaitForEvents(ch EventChan, timeout time.Duration) []Event

func (*Event) GetData

func (e *Event) GetData() interface{}

func (*Event) GetHeader

func (e *Event) GetHeader() events.EventHeader

type EventChan

type EventChan = chan Event

type EventsServer

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

func NewEventsServer

func NewEventsServer(t *testing.T, uri string) *EventsServer

func (*EventsServer) Close

func (s *EventsServer) Close(t *testing.T)

func (*EventsServer) GetPort

func (s *EventsServer) GetPort(t *testing.T) string

func (*EventsServer) Run

func (s *EventsServer) Run(t *testing.T) EventChan

func (*EventsServer) WaitForClose

func (s *EventsServer) WaitForClose()

type SubscriptionType

type SubscriptionType int
const (
	SubscriptionType_Devices SubscriptionType = iota
	SubscriptionType_Device
	SubscriptionType_Resource
)

Jump to

Keyboard shortcuts

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