cim

package
v0.0.0-...-34fd565 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextBroker

type ContextBroker interface {
}

type ContextInformationManagerMock

type ContextInformationManagerMock struct {
	// CreateEntityFunc mocks the CreateEntity method.
	CreateEntityFunc func(ctx context.Context, tenant string, entity types.Entity, headers map[string][]string) (*ngsild.CreateEntityResult, error)

	// DeleteEntityFunc mocks the DeleteEntity method.
	DeleteEntityFunc func(ctx context.Context, tenant string, entityID string) (*ngsild.DeleteEntityResult, error)

	// MergeEntityFunc mocks the MergeEntity method.
	MergeEntityFunc func(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.MergeEntityResult, error)

	// QueryEntitiesFunc mocks the QueryEntities method.
	QueryEntitiesFunc func(ctx context.Context, tenant string, entityTypes []string, entityAttributes []string, query string, headers map[string][]string) (*ngsild.QueryEntitiesResult, error)

	// QueryTemporalEvolutionOfEntitiesFunc mocks the QueryTemporalEvolutionOfEntities method.
	QueryTemporalEvolutionOfEntitiesFunc func(ctx context.Context, tenant string, entityIDs []string, entityTypes []string, params TemporalQueryParams, headers map[string][]string) (*ngsild.QueryTemporalEntitiesResult, error)

	// RetrieveEntityFunc mocks the RetrieveEntity method.
	RetrieveEntityFunc func(ctx context.Context, tenant string, entityID string, headers map[string][]string) (types.Entity, error)

	// RetrieveTemporalEvolutionOfEntityFunc mocks the RetrieveTemporalEvolutionOfEntity method.
	RetrieveTemporalEvolutionOfEntityFunc func(ctx context.Context, tenant string, entityID string, params TemporalQueryParams, headers map[string][]string) (*ngsild.RetrieveTemporalEvolutionOfEntityResult, error)

	// RetrieveTypesFunc mocks the RetrieveTypes method.
	RetrieveTypesFunc func(ctx context.Context, tenant string, headers map[string][]string) ([]string, error)

	// StartFunc mocks the Start method.
	StartFunc func() error

	// StopFunc mocks the Stop method.
	StopFunc func() error

	// UpdateEntityAttributesFunc mocks the UpdateEntityAttributes method.
	UpdateEntityAttributesFunc func(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.UpdateEntityAttributesResult, error)
	// contains filtered or unexported fields
}

ContextInformationManagerMock is a mock implementation of ContextInformationManager.

func TestSomethingThatUsesContextInformationManager(t *testing.T) {

	// make and configure a mocked ContextInformationManager
	mockedContextInformationManager := &ContextInformationManagerMock{
		CreateEntityFunc: func(ctx context.Context, tenant string, entity types.Entity, headers map[string][]string) (*ngsild.CreateEntityResult, error) {
			panic("mock out the CreateEntity method")
		},
		DeleteEntityFunc: func(ctx context.Context, tenant string, entityID string) (*ngsild.DeleteEntityResult, error) {
			panic("mock out the DeleteEntity method")
		},
		MergeEntityFunc: func(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.MergeEntityResult, error) {
			panic("mock out the MergeEntity method")
		},
		QueryEntitiesFunc: func(ctx context.Context, tenant string, entityTypes []string, entityAttributes []string, query string, headers map[string][]string) (*ngsild.QueryEntitiesResult, error) {
			panic("mock out the QueryEntities method")
		},
		QueryTemporalEvolutionOfEntitiesFunc: func(ctx context.Context, tenant string, entityIDs []string, entityTypes []string, params TemporalQueryParams, headers map[string][]string) (*ngsild.QueryTemporalEntitiesResult, error) {
			panic("mock out the QueryTemporalEvolutionOfEntities method")
		},
		RetrieveEntityFunc: func(ctx context.Context, tenant string, entityID string, headers map[string][]string) (types.Entity, error) {
			panic("mock out the RetrieveEntity method")
		},
		RetrieveTemporalEvolutionOfEntityFunc: func(ctx context.Context, tenant string, entityID string, params TemporalQueryParams, headers map[string][]string) (*ngsild.RetrieveTemporalEvolutionOfEntityResult, error) {
			panic("mock out the RetrieveTemporalEvolutionOfEntity method")
		},
		RetrieveTypesFunc: func(ctx context.Context, tenant string, headers map[string][]string) ([]string, error) {
			panic("mock out the RetrieveTypes method")
		},
		StartFunc: func() error {
			panic("mock out the Start method")
		},
		StopFunc: func() error {
			panic("mock out the Stop method")
		},
		UpdateEntityAttributesFunc: func(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.UpdateEntityAttributesResult, error) {
			panic("mock out the UpdateEntityAttributes method")
		},
	}

	// use mockedContextInformationManager in code that requires ContextInformationManager
	// and then make assertions.

}

func (*ContextInformationManagerMock) CreateEntity

func (mock *ContextInformationManagerMock) CreateEntity(ctx context.Context, tenant string, entity types.Entity, headers map[string][]string) (*ngsild.CreateEntityResult, error)

CreateEntity calls CreateEntityFunc.

func (*ContextInformationManagerMock) CreateEntityCalls

func (mock *ContextInformationManagerMock) CreateEntityCalls() []struct {
	Ctx     context.Context
	Tenant  string
	Entity  types.Entity
	Headers map[string][]string
}

CreateEntityCalls gets all the calls that were made to CreateEntity. Check the length with:

len(mockedContextInformationManager.CreateEntityCalls())

func (*ContextInformationManagerMock) DeleteEntity

func (mock *ContextInformationManagerMock) DeleteEntity(ctx context.Context, tenant string, entityID string) (*ngsild.DeleteEntityResult, error)

DeleteEntity calls DeleteEntityFunc.

func (*ContextInformationManagerMock) DeleteEntityCalls

func (mock *ContextInformationManagerMock) DeleteEntityCalls() []struct {
	Ctx      context.Context
	Tenant   string
	EntityID string
}

DeleteEntityCalls gets all the calls that were made to DeleteEntity. Check the length with:

len(mockedContextInformationManager.DeleteEntityCalls())

func (*ContextInformationManagerMock) MergeEntity

func (mock *ContextInformationManagerMock) MergeEntity(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.MergeEntityResult, error)

MergeEntity calls MergeEntityFunc.

func (*ContextInformationManagerMock) MergeEntityCalls

func (mock *ContextInformationManagerMock) MergeEntityCalls() []struct {
	Ctx      context.Context
	Tenant   string
	EntityID string
	Fragment types.EntityFragment
	Headers  map[string][]string
}

MergeEntityCalls gets all the calls that were made to MergeEntity. Check the length with:

len(mockedContextInformationManager.MergeEntityCalls())

func (*ContextInformationManagerMock) QueryEntities

func (mock *ContextInformationManagerMock) QueryEntities(ctx context.Context, tenant string, entityTypes []string, entityAttributes []string, query string, headers map[string][]string) (*ngsild.QueryEntitiesResult, error)

QueryEntities calls QueryEntitiesFunc.

func (*ContextInformationManagerMock) QueryEntitiesCalls

func (mock *ContextInformationManagerMock) QueryEntitiesCalls() []struct {
	Ctx              context.Context
	Tenant           string
	EntityTypes      []string
	EntityAttributes []string
	Query            string
	Headers          map[string][]string
}

QueryEntitiesCalls gets all the calls that were made to QueryEntities. Check the length with:

len(mockedContextInformationManager.QueryEntitiesCalls())

func (*ContextInformationManagerMock) QueryTemporalEvolutionOfEntities

func (mock *ContextInformationManagerMock) QueryTemporalEvolutionOfEntities(ctx context.Context, tenant string, entityIDs []string, entityTypes []string, params TemporalQueryParams, headers map[string][]string) (*ngsild.QueryTemporalEntitiesResult, error)

QueryTemporalEvolutionOfEntities calls QueryTemporalEvolutionOfEntitiesFunc.

func (*ContextInformationManagerMock) QueryTemporalEvolutionOfEntitiesCalls

func (mock *ContextInformationManagerMock) QueryTemporalEvolutionOfEntitiesCalls() []struct {
	Ctx         context.Context
	Tenant      string
	EntityIDs   []string
	EntityTypes []string
	Params      TemporalQueryParams
	Headers     map[string][]string
}

QueryTemporalEvolutionOfEntitiesCalls gets all the calls that were made to QueryTemporalEvolutionOfEntities. Check the length with:

len(mockedContextInformationManager.QueryTemporalEvolutionOfEntitiesCalls())

func (*ContextInformationManagerMock) RetrieveEntity

func (mock *ContextInformationManagerMock) RetrieveEntity(ctx context.Context, tenant string, entityID string, headers map[string][]string) (types.Entity, error)

RetrieveEntity calls RetrieveEntityFunc.

func (*ContextInformationManagerMock) RetrieveEntityCalls

func (mock *ContextInformationManagerMock) RetrieveEntityCalls() []struct {
	Ctx      context.Context
	Tenant   string
	EntityID string
	Headers  map[string][]string
}

RetrieveEntityCalls gets all the calls that were made to RetrieveEntity. Check the length with:

len(mockedContextInformationManager.RetrieveEntityCalls())

func (*ContextInformationManagerMock) RetrieveTemporalEvolutionOfEntity

func (mock *ContextInformationManagerMock) RetrieveTemporalEvolutionOfEntity(ctx context.Context, tenant string, entityID string, params TemporalQueryParams, headers map[string][]string) (*ngsild.RetrieveTemporalEvolutionOfEntityResult, error)

RetrieveTemporalEvolutionOfEntity calls RetrieveTemporalEvolutionOfEntityFunc.

func (*ContextInformationManagerMock) RetrieveTemporalEvolutionOfEntityCalls

func (mock *ContextInformationManagerMock) RetrieveTemporalEvolutionOfEntityCalls() []struct {
	Ctx      context.Context
	Tenant   string
	EntityID string
	Params   TemporalQueryParams
	Headers  map[string][]string
}

RetrieveTemporalEvolutionOfEntityCalls gets all the calls that were made to RetrieveTemporalEvolutionOfEntity. Check the length with:

len(mockedContextInformationManager.RetrieveTemporalEvolutionOfEntityCalls())

func (*ContextInformationManagerMock) RetrieveTypes

func (mock *ContextInformationManagerMock) RetrieveTypes(ctx context.Context, tenant string, headers map[string][]string) ([]string, error)

RetrieveTypes calls RetrieveTypesFunc.

func (*ContextInformationManagerMock) RetrieveTypesCalls

func (mock *ContextInformationManagerMock) RetrieveTypesCalls() []struct {
	Ctx     context.Context
	Tenant  string
	Headers map[string][]string
}

RetrieveTypesCalls gets all the calls that were made to RetrieveTypes. Check the length with:

len(mockedContextInformationManager.RetrieveTypesCalls())

func (*ContextInformationManagerMock) Start

func (mock *ContextInformationManagerMock) Start() error

Start calls StartFunc.

func (*ContextInformationManagerMock) StartCalls

func (mock *ContextInformationManagerMock) StartCalls() []struct {
}

StartCalls gets all the calls that were made to Start. Check the length with:

len(mockedContextInformationManager.StartCalls())

func (*ContextInformationManagerMock) Stop

func (mock *ContextInformationManagerMock) Stop() error

Stop calls StopFunc.

func (*ContextInformationManagerMock) StopCalls

func (mock *ContextInformationManagerMock) StopCalls() []struct {
}

StopCalls gets all the calls that were made to Stop. Check the length with:

len(mockedContextInformationManager.StopCalls())

func (*ContextInformationManagerMock) UpdateEntityAttributes

func (mock *ContextInformationManagerMock) UpdateEntityAttributes(ctx context.Context, tenant string, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.UpdateEntityAttributesResult, error)

UpdateEntityAttributes calls UpdateEntityAttributesFunc.

func (*ContextInformationManagerMock) UpdateEntityAttributesCalls

func (mock *ContextInformationManagerMock) UpdateEntityAttributesCalls() []struct {
	Ctx      context.Context
	Tenant   string
	EntityID string
	Fragment types.EntityFragment
	Headers  map[string][]string
}

UpdateEntityAttributesCalls gets all the calls that were made to UpdateEntityAttributes. Check the length with:

len(mockedContextInformationManager.UpdateEntityAttributesCalls())

type ContextSource

type ContextSource interface {
}

type EntityAttributesUpdater

type EntityAttributesUpdater interface {
	UpdateEntityAttributes(ctx context.Context, tenant, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.UpdateEntityAttributesResult, error)
}

type EntityCreator

type EntityCreator interface {
	CreateEntity(ctx context.Context, tenant string, entity types.Entity, headers map[string][]string) (*ngsild.CreateEntityResult, error)
}

type EntityDeleter

type EntityDeleter interface {
	DeleteEntity(ctx context.Context, tenant, entityID string) (*ngsild.DeleteEntityResult, error)
}

type EntityMerger

type EntityMerger interface {
	MergeEntity(ctx context.Context, tenant, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.MergeEntityResult, error)
}

type EntityQuerier

type EntityQuerier interface {
	QueryEntities(ctx context.Context, tenant string, entityTypes, entityAttributes []string, query string, headers map[string][]string) (*ngsild.QueryEntitiesResult, error)
}

type EntityRetriever

type EntityRetriever interface {
	RetrieveEntity(ctx context.Context, tenant, entityID string, headers map[string][]string) (types.Entity, error)
}

type EntityTemporalQuerier

type EntityTemporalQuerier interface {
	QueryTemporalEvolutionOfEntities(ctx context.Context, tenant string, entityIDs, entityTypes []string, params TemporalQueryParams, headers map[string][]string) (*ngsild.QueryTemporalEntitiesResult, error)
}

type EntityTemporalRetriever

type EntityTemporalRetriever interface {
	RetrieveTemporalEvolutionOfEntity(ctx context.Context, tenant, entityID string, params TemporalQueryParams, headers map[string][]string) (*ngsild.RetrieveTemporalEvolutionOfEntityResult, error)
}

type TemporalQueryParams

type TemporalQueryParams interface {
	IDs() ([]string, bool)
	Types() ([]string, bool)
	Attributes() ([]string, bool)
	TemporalRelation() (string, bool)
	TimeAt() (time.Time, bool)
	EndTimeAt() (time.Time, bool)
	LastN() (uint64, bool)
}

type TypesRetriever

type TypesRetriever interface {
	RetrieveTypes(ctx context.Context, tenant string, headers map[string][]string) ([]string, error)
}

Jump to

Keyboard shortcuts

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