Documentation
¶
Overview ¶
moduletools contains helpers that are passed to modules as part of their capability methods
Index ¶
- func NormalizeWeights(weights []float32) []float32
- func SortStringKeys(schemaMap map[string]interface{}) []string
- type ClassConfig
- type InitParams
- type MockModuleInitParams
- func (_m *MockModuleInitParams) EXPECT() *MockModuleInitParams_Expecter
- func (_m *MockModuleInitParams) GetAppState() interface{}
- func (_m *MockModuleInitParams) GetConfig() *config.Config
- func (_m *MockModuleInitParams) GetLogger() logrus.FieldLogger
- func (_m *MockModuleInitParams) GetMetricsRegisterer() prometheus.Registerer
- func (_m *MockModuleInitParams) GetStorageProvider() StorageProvider
- type MockModuleInitParams_Expecter
- func (_e *MockModuleInitParams_Expecter) GetAppState() *MockModuleInitParams_GetAppState_Call
- func (_e *MockModuleInitParams_Expecter) GetConfig() *MockModuleInitParams_GetConfig_Call
- func (_e *MockModuleInitParams_Expecter) GetLogger() *MockModuleInitParams_GetLogger_Call
- func (_e *MockModuleInitParams_Expecter) GetMetricsRegisterer() *MockModuleInitParams_GetMetricsRegisterer_Call
- func (_e *MockModuleInitParams_Expecter) GetStorageProvider() *MockModuleInitParams_GetStorageProvider_Call
- type MockModuleInitParams_GetAppState_Call
- func (_c *MockModuleInitParams_GetAppState_Call) Return(_a0 interface{}) *MockModuleInitParams_GetAppState_Call
- func (_c *MockModuleInitParams_GetAppState_Call) Run(run func()) *MockModuleInitParams_GetAppState_Call
- func (_c *MockModuleInitParams_GetAppState_Call) RunAndReturn(run func() interface{}) *MockModuleInitParams_GetAppState_Call
- type MockModuleInitParams_GetConfig_Call
- func (_c *MockModuleInitParams_GetConfig_Call) Return(_a0 *config.Config) *MockModuleInitParams_GetConfig_Call
- func (_c *MockModuleInitParams_GetConfig_Call) Run(run func()) *MockModuleInitParams_GetConfig_Call
- func (_c *MockModuleInitParams_GetConfig_Call) RunAndReturn(run func() *config.Config) *MockModuleInitParams_GetConfig_Call
- type MockModuleInitParams_GetLogger_Call
- func (_c *MockModuleInitParams_GetLogger_Call) Return(_a0 logrus.FieldLogger) *MockModuleInitParams_GetLogger_Call
- func (_c *MockModuleInitParams_GetLogger_Call) Run(run func()) *MockModuleInitParams_GetLogger_Call
- func (_c *MockModuleInitParams_GetLogger_Call) RunAndReturn(run func() logrus.FieldLogger) *MockModuleInitParams_GetLogger_Call
- type MockModuleInitParams_GetMetricsRegisterer_Call
- func (_c *MockModuleInitParams_GetMetricsRegisterer_Call) Return(_a0 prometheus.Registerer) *MockModuleInitParams_GetMetricsRegisterer_Call
- func (_c *MockModuleInitParams_GetMetricsRegisterer_Call) Run(run func()) *MockModuleInitParams_GetMetricsRegisterer_Call
- func (_c *MockModuleInitParams_GetMetricsRegisterer_Call) RunAndReturn(run func() prometheus.Registerer) *MockModuleInitParams_GetMetricsRegisterer_Call
- type MockModuleInitParams_GetStorageProvider_Call
- func (_c *MockModuleInitParams_GetStorageProvider_Call) Return(_a0 StorageProvider) *MockModuleInitParams_GetStorageProvider_Call
- func (_c *MockModuleInitParams_GetStorageProvider_Call) Run(run func()) *MockModuleInitParams_GetStorageProvider_Call
- func (_c *MockModuleInitParams_GetStorageProvider_Call) RunAndReturn(run func() StorageProvider) *MockModuleInitParams_GetStorageProvider_Call
- type ModuleInitParams
- type ScanFn
- type Storage
- type StorageProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeWeights ¶ added in v1.25.0
func SortStringKeys ¶ added in v1.25.0
Types ¶
type ClassConfig ¶
type ClassConfig interface {
TargetVector() string
Tenant() string
Class() map[string]interface{}
ClassByModuleName(moduleName string) map[string]interface{}
Property(propName string) map[string]interface{}
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() interface{}
func (*InitParams) GetConfig ¶ added in v1.21.4
func (p *InitParams) GetConfig() *config.Config
func (*InitParams) GetLogger ¶
func (p *InitParams) GetLogger() logrus.FieldLogger
func (*InitParams) GetMetricsRegisterer ¶ added in v1.32.0
func (p *InitParams) GetMetricsRegisterer() prometheus.Registerer
func (*InitParams) GetStorageProvider ¶
func (p *InitParams) GetStorageProvider() StorageProvider
type MockModuleInitParams ¶ added in v1.32.0
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 (_m *MockModuleInitParams) EXPECT() *MockModuleInitParams_Expecter
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) 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
func (*MockModuleInitParams) GetStorageProvider ¶ added in v1.32.0
func (_m *MockModuleInitParams) GetStorageProvider() StorageProvider
GetStorageProvider 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
func (_e *MockModuleInitParams_Expecter) GetAppState() *MockModuleInitParams_GetAppState_Call
GetAppState is a helper method to define mock.On call
func (*MockModuleInitParams_Expecter) GetConfig ¶ added in v1.32.0
func (_e *MockModuleInitParams_Expecter) GetConfig() *MockModuleInitParams_GetConfig_Call
GetConfig is a helper method to define mock.On call
func (*MockModuleInitParams_Expecter) GetLogger ¶ added in v1.32.0
func (_e *MockModuleInitParams_Expecter) GetLogger() *MockModuleInitParams_GetLogger_Call
GetLogger is a helper method to define mock.On call
func (*MockModuleInitParams_Expecter) GetMetricsRegisterer ¶ added in v1.32.0
func (_e *MockModuleInitParams_Expecter) GetMetricsRegisterer() *MockModuleInitParams_GetMetricsRegisterer_Call
GetMetricsRegisterer is a helper method to define mock.On call
func (*MockModuleInitParams_Expecter) GetStorageProvider ¶ added in v1.32.0
func (_e *MockModuleInitParams_Expecter) GetStorageProvider() *MockModuleInitParams_GetStorageProvider_Call
GetStorageProvider is a helper method to define mock.On call
type MockModuleInitParams_GetAppState_Call ¶ added in v1.32.0
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 (_c *MockModuleInitParams_GetAppState_Call) Return(_a0 interface{}) *MockModuleInitParams_GetAppState_Call
func (*MockModuleInitParams_GetAppState_Call) Run ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetAppState_Call) Run(run func()) *MockModuleInitParams_GetAppState_Call
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
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 (_c *MockModuleInitParams_GetConfig_Call) Return(_a0 *config.Config) *MockModuleInitParams_GetConfig_Call
func (*MockModuleInitParams_GetConfig_Call) Run ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetConfig_Call) Run(run func()) *MockModuleInitParams_GetConfig_Call
func (*MockModuleInitParams_GetConfig_Call) RunAndReturn ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetConfig_Call) RunAndReturn(run func() *config.Config) *MockModuleInitParams_GetConfig_Call
type MockModuleInitParams_GetLogger_Call ¶ added in v1.32.0
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 (_c *MockModuleInitParams_GetLogger_Call) Return(_a0 logrus.FieldLogger) *MockModuleInitParams_GetLogger_Call
func (*MockModuleInitParams_GetLogger_Call) Run ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetLogger_Call) Run(run func()) *MockModuleInitParams_GetLogger_Call
func (*MockModuleInitParams_GetLogger_Call) RunAndReturn ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetLogger_Call) RunAndReturn(run func() logrus.FieldLogger) *MockModuleInitParams_GetLogger_Call
type MockModuleInitParams_GetMetricsRegisterer_Call ¶ added in v1.32.0
MockModuleInitParams_GetMetricsRegisterer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMetricsRegisterer'
func (*MockModuleInitParams_GetMetricsRegisterer_Call) Run ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetMetricsRegisterer_Call) Run(run func()) *MockModuleInitParams_GetMetricsRegisterer_Call
func (*MockModuleInitParams_GetMetricsRegisterer_Call) RunAndReturn ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetMetricsRegisterer_Call) RunAndReturn(run func() prometheus.Registerer) *MockModuleInitParams_GetMetricsRegisterer_Call
type MockModuleInitParams_GetStorageProvider_Call ¶ added in v1.32.0
MockModuleInitParams_GetStorageProvider_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStorageProvider'
func (*MockModuleInitParams_GetStorageProvider_Call) Return ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetStorageProvider_Call) Return(_a0 StorageProvider) *MockModuleInitParams_GetStorageProvider_Call
func (*MockModuleInitParams_GetStorageProvider_Call) Run ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetStorageProvider_Call) Run(run func()) *MockModuleInitParams_GetStorageProvider_Call
func (*MockModuleInitParams_GetStorageProvider_Call) RunAndReturn ¶ added in v1.32.0
func (_c *MockModuleInitParams_GetStorageProvider_Call) RunAndReturn(run func() StorageProvider) *MockModuleInitParams_GetStorageProvider_Call
type ModuleInitParams ¶
type ModuleInitParams interface {
GetStorageProvider() StorageProvider
GetAppState() interface{}
GetLogger() logrus.FieldLogger
GetConfig() *config.Config
GetMetricsRegisterer() prometheus.Registerer
}
func NewInitParams ¶
func NewInitParams(storageProvider StorageProvider, appState interface{}, config *config.Config, logger logrus.FieldLogger, registerer prometheus.Registerer, ) ModuleInitParams