mock

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Camunda = &CamundaMock{ResetOnGetInterface: true}
View Source
var Kafka = &KafkaMock{}
View Source
var Marshaller = &MarshallerMock{}
View Source
var Repo = &RepoMock{ResetOnGetRepoInterface: true}

Functions

func CleanKafkaMock

func CleanKafkaMock()

func GetTimescaleMockFactory

func GetTimescaleMockFactory(responses TimescaleMockResponses) func(ctx context.Context, config util.Config) (timescale.Interface, error)

func Timescale

func Timescale(ctx context.Context, config util.Config) (timescale.Interface, error)

Types

type CamundaMock

type CamundaMock struct {
	ResetOnGetInterface bool

	Camunda *camunda.Camunda
	// contains filtered or unexported fields
}

func (*CamundaMock) AddTask

func (this *CamundaMock) AddTask(task messages.CamundaExternalTask)

func (*CamundaMock) CompleteTask

func (this *CamundaMock) CompleteTask(taskInfo messages.TaskInfo, outputName string, output interface{}) (err error)

func (*CamundaMock) Error

func (this *CamundaMock) Error(externalTaskId string, processInstanceId string, processDefinitionId string, msg string, tenantId string)

func (*CamundaMock) Get

func (*CamundaMock) GetStatus

func (this *CamundaMock) GetStatus() (fetched map[string]messages.CamundaExternalTask, completed map[string]interface{}, failed map[string]messages.CamundaExternalTask)

func (*CamundaMock) GetTasks

func (this *CamundaMock) GetTasks() (tasks []messages.CamundaExternalTask, err error)

func (*CamundaMock) GetWorkerId

func (this *CamundaMock) GetWorkerId() string

func (*CamundaMock) Init

func (this *CamundaMock) Init()

func (*CamundaMock) SetRetry

func (this *CamundaMock) SetRetry(taskid string, tenantId string, number int64)

func (*CamundaMock) UnlockTask

func (this *CamundaMock) UnlockTask(taskInfo messages.TaskInfo) (err error)

type KafkaMock

type KafkaMock struct {
	Produced map[string][]string
	// contains filtered or unexported fields
}

func (*KafkaMock) Close

func (this *KafkaMock) Close()

func (*KafkaMock) GetProduced

func (this *KafkaMock) GetProduced(topic string) []string

func (*KafkaMock) Log

func (this *KafkaMock) Log(logger *log.Logger)

func (*KafkaMock) New

func (this *KafkaMock) New() *KafkaMock

func (*KafkaMock) NewConsumer

func (this *KafkaMock) NewConsumer(ctx context.Context, config util.Config, respListener func(msg string) error, errListener func(msg string) error) (err error)

func (*KafkaMock) NewProducer

func (this *KafkaMock) NewProducer(ctx context.Context, config util.Config) (com.ProducerInterface, error)

func (*KafkaMock) Produce

func (this *KafkaMock) Produce(topic string, message string) error

func (*KafkaMock) ProduceWithKey

func (this *KafkaMock) ProduceWithKey(topic string, key string, message string) error

func (*KafkaMock) Stop

func (this *KafkaMock) Stop()

func (*KafkaMock) Subscribe

func (this *KafkaMock) Subscribe(topic string, listener func(msg string) error)

type MarshallerMock

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

func (*MarshallerMock) MarshalFromServiceAndProtocol

func (this *MarshallerMock) MarshalFromServiceAndProtocol(characteristicId string, service model.Service, protocol model.Protocol, characteristicData interface{}, configurables []marshaller.Configurable) (result map[string]string, err error)

func (*MarshallerMock) MarshalV2

func (this *MarshallerMock) MarshalV2(service model.Service, protocol model.Protocol, data []marshaller.MarshallingV2RequestData) (result map[string]string, err error)

func (*MarshallerMock) New

func (*MarshallerMock) UnmarshalFromServiceAndProtocol

func (this *MarshallerMock) UnmarshalFromServiceAndProtocol(characteristicId string, service model.Service, protocol model.Protocol, message map[string]string, hints []string) (characteristicData interface{}, err error)

func (*MarshallerMock) UnmarshalV2

func (this *MarshallerMock) UnmarshalV2(request marshaller.UnmarshallingV2Request) (result interface{}, err error)

type RepoMock

type RepoMock struct {
	ResetOnGetRepoInterface bool
	// contains filtered or unexported fields
}

func (*RepoMock) Get

func (this *RepoMock) Get(configType util.Config) (devicerepository.RepoInterface, error)

func (*RepoMock) GetDevice

func (this *RepoMock) GetDevice(token devicerepository.Impersonate, id string) (model.Device, error)

func (*RepoMock) GetDeviceGroup

func (this *RepoMock) GetDeviceGroup(token devicerepository.Impersonate, id string) (model.DeviceGroup, error)

func (*RepoMock) GetDeviceInfo

func (this *RepoMock) GetDeviceInfo(instanceId string, serviceId string, user string) (instance model.Device, service model.Service, err error)

func (*RepoMock) GetDeviceType

func (this *RepoMock) GetDeviceType(token devicerepository.Impersonate, id string) (model.DeviceType, error)

func (*RepoMock) GetProtocol

func (this *RepoMock) GetProtocol(token devicerepository.Impersonate, id string) (model.Protocol, error)

func (*RepoMock) GetService

func (this *RepoMock) GetService(token devicerepository.Impersonate, device model.Device, serviceId string) (model.Service, error)

func (*RepoMock) GetToken

func (this *RepoMock) GetToken(user string) (devicerepository.Impersonate, error)

func (*RepoMock) New

func (this *RepoMock) New() *RepoMock

func (*RepoMock) RegisterDevice

func (this *RepoMock) RegisterDevice(device model.Device)

func (*RepoMock) RegisterDeviceGroup

func (this *RepoMock) RegisterDeviceGroup(deviceGroup model.DeviceGroup)

func (*RepoMock) RegisterDeviceType

func (this *RepoMock) RegisterDeviceType(deviceType model.DeviceType)

func (*RepoMock) RegisterProtocol

func (this *RepoMock) RegisterProtocol(protocol model.Protocol)

func (*RepoMock) RegisterService

func (this *RepoMock) RegisterService(service model.Service)

type TimescaleMock

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

func (*TimescaleMock) Query

func (this *TimescaleMock) Query(token string, request []messages.TimescaleRequest, timeout time.Duration) (result []messages.TimescaleResponse, err error)

type TimescaleMockResponses

type TimescaleMockResponses = map[string]map[string]map[string]interface{}

Jump to

Keyboard shortcuts

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