mocks

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mocks contains mocks for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefinition

func CreateDefinition(channels, subtopics []string) twins.Definition

CreateDefinition creates twin definition.

func CreateMessage

func CreateMessage(attr twins.Attribute, recs []senml.Record) (*messaging.Message, error)

CreateMessage creates Magistrala message using SenML record array.

func CreateSenML

func CreateSenML(recs []senml.Record)

CreateSenML creates SenML record array.

func CreateTwin

func CreateTwin(channels, subtopics []string) twins.Twin

CreateTwin creates twin.

func NewBroker

func NewBroker(sub map[string]string) messaging.Publisher

NewBroker returns mock message publisher.

func NewService

func NewService() (twins.Service, *authmocks.AuthClient)

NewService use mock dependencies to create real twins service.

func NewStateRepository

func NewStateRepository() twins.StateRepository

NewStateRepository creates in-memory twin repository.

func NewTwinCache

func NewTwinCache() twins.TwinCache

NewTwinCache returns mock cache instance.

func NewTwinRepository

func NewTwinRepository() twins.TwinRepository

NewTwinRepository creates in-memory twin repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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