test

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C2CURI

func C2CURI(uri string) string

func DecodeEvent

func DecodeEvent(t *testing.T, etype events.EventType, data []byte) interface{}

func GetUniqueSubscriptionID

func GetUniqueSubscriptionID(subIDS ...string) string

func MakeConfig

func MakeConfig(t *testing.T) service.Config

func MakeStorageConfig

func MakeStorageConfig() service.StorageConfig

func New

func New(t *testing.T, cfg service.Config) func()

func NewTestListener

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

func SetUp

func SetUp(t *testing.T) (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(t *testing.T, ctx context.Context, token, deviceID, href string, eventTypes events.EventTypes) string

func (*C2CSubscriber) Unsubscribe

func (c *C2CSubscriber) Unsubscribe(t *testing.T, ctx context.Context, 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