moduletools

package
v1.38.16 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: BSD-3-Clause Imports: 6 Imported by: 3

Documentation

Overview

moduletools contains helpers that are passed to modules as part of their capability methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeWeights added in v1.25.0

func NormalizeWeights(weights []float32) []float32

func SortStringKeys added in v1.25.0

func SortStringKeys(schemaMap map[string]any) []string

Types

type ClassConfig

type ClassConfig interface {
	TargetVector() string
	Tenant() string
	Class() map[string]any
	ClassByModuleName(moduleName string) map[string]any
	Property(propName string) map[string]any
	PropertiesDataTypes() map[string]schema.DataType
	Config() *config.Config
}

ClassConfig is a helper type which is passed to the module to read it's per-class config. This is - among other places - used when vectorizing and when validation schema config

type InitParams

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

func (*InitParams) GetAppState

func (p *InitParams) GetAppState() any

func (*InitParams) GetConfig added in v1.21.4

func (p *InitParams) GetConfig() *config.Config

func (*InitParams) GetDataPath

func (p *InitParams) GetDataPath() string

func (*InitParams) GetLogger

func (p *InitParams) GetLogger() logrus.FieldLogger

func (*InitParams) GetMetricsRegisterer added in v1.32.0

func (p *InitParams) GetMetricsRegisterer() prometheus.Registerer

type MockModuleInitParams added in v1.32.0

type MockModuleInitParams struct {
	mock.Mock
}

MockModuleInitParams is an autogenerated mock type for the ModuleInitParams type

func NewMockModuleInitParams added in v1.32.0

func NewMockModuleInitParams(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockModuleInitParams

NewMockModuleInitParams creates a new instance of MockModuleInitParams. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockModuleInitParams) EXPECT added in v1.32.0

func (*MockModuleInitParams) GetAppState added in v1.32.0

func (_m *MockModuleInitParams) GetAppState() interface{}

GetAppState provides a mock function with no fields

func (*MockModuleInitParams) GetConfig added in v1.32.0

func (_m *MockModuleInitParams) GetConfig() *config.Config

GetConfig provides a mock function with no fields

func (*MockModuleInitParams) GetDataPath

func (_m *MockModuleInitParams) GetDataPath() string

GetDataPath provides a mock function with no fields

func (*MockModuleInitParams) GetLogger added in v1.32.0

func (_m *MockModuleInitParams) GetLogger() logrus.FieldLogger

GetLogger provides a mock function with no fields

func (*MockModuleInitParams) GetMetricsRegisterer added in v1.32.0

func (_m *MockModuleInitParams) GetMetricsRegisterer() prometheus.Registerer

GetMetricsRegisterer provides a mock function with no fields

type MockModuleInitParams_Expecter added in v1.32.0

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

func (*MockModuleInitParams_Expecter) GetAppState added in v1.32.0

GetAppState is a helper method to define mock.On call

func (*MockModuleInitParams_Expecter) GetConfig added in v1.32.0

GetConfig is a helper method to define mock.On call

func (*MockModuleInitParams_Expecter) GetDataPath

GetDataPath is a helper method to define mock.On call

func (*MockModuleInitParams_Expecter) GetLogger added in v1.32.0

GetLogger is a helper method to define mock.On call

func (*MockModuleInitParams_Expecter) GetMetricsRegisterer added in v1.32.0

GetMetricsRegisterer is a helper method to define mock.On call

type MockModuleInitParams_GetAppState_Call added in v1.32.0

type MockModuleInitParams_GetAppState_Call struct {
	*mock.Call
}

MockModuleInitParams_GetAppState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAppState'

func (*MockModuleInitParams_GetAppState_Call) Return added in v1.32.0

func (*MockModuleInitParams_GetAppState_Call) Run added in v1.32.0

func (*MockModuleInitParams_GetAppState_Call) RunAndReturn added in v1.32.0

func (_c *MockModuleInitParams_GetAppState_Call) RunAndReturn(run func() interface{}) *MockModuleInitParams_GetAppState_Call

type MockModuleInitParams_GetConfig_Call added in v1.32.0

type MockModuleInitParams_GetConfig_Call struct {
	*mock.Call
}

MockModuleInitParams_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'

func (*MockModuleInitParams_GetConfig_Call) Return added in v1.32.0

func (*MockModuleInitParams_GetConfig_Call) Run added in v1.32.0

func (*MockModuleInitParams_GetConfig_Call) RunAndReturn added in v1.32.0

type MockModuleInitParams_GetDataPath_Call

type MockModuleInitParams_GetDataPath_Call struct {
	*mock.Call
}

MockModuleInitParams_GetDataPath_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDataPath'

func (*MockModuleInitParams_GetDataPath_Call) Return

func (*MockModuleInitParams_GetDataPath_Call) Run

func (*MockModuleInitParams_GetDataPath_Call) RunAndReturn

type MockModuleInitParams_GetLogger_Call added in v1.32.0

type MockModuleInitParams_GetLogger_Call struct {
	*mock.Call
}

MockModuleInitParams_GetLogger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogger'

func (*MockModuleInitParams_GetLogger_Call) Return added in v1.32.0

func (*MockModuleInitParams_GetLogger_Call) Run added in v1.32.0

func (*MockModuleInitParams_GetLogger_Call) RunAndReturn added in v1.32.0

type MockModuleInitParams_GetMetricsRegisterer_Call added in v1.32.0

type MockModuleInitParams_GetMetricsRegisterer_Call struct {
	*mock.Call
}

MockModuleInitParams_GetMetricsRegisterer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetricsRegisterer'

func (*MockModuleInitParams_GetMetricsRegisterer_Call) Return added in v1.32.0

func (*MockModuleInitParams_GetMetricsRegisterer_Call) Run added in v1.32.0

func (*MockModuleInitParams_GetMetricsRegisterer_Call) RunAndReturn added in v1.32.0

type ModuleInitParams

type ModuleInitParams interface {
	GetDataPath() string
	GetAppState() any
	GetLogger() logrus.FieldLogger
	GetConfig() *config.Config
	GetMetricsRegisterer() prometheus.Registerer
}

func NewInitParams

func NewInitParams(dataPath string, appState any,
	config *config.Config, logger logrus.FieldLogger, registerer prometheus.Registerer,
) ModuleInitParams

Jump to

Keyboard shortcuts

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