moduletools

package
v1.25.9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

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]interface{}) []string

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{}
}

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) GetStorageProvider

func (p *InitParams) GetStorageProvider() StorageProvider

type ModuleInitParams

type ModuleInitParams interface {
	GetStorageProvider() StorageProvider
	GetAppState() interface{}
	GetLogger() logrus.FieldLogger
	GetConfig() config.Config
}

func NewInitParams

func NewInitParams(storageProvider StorageProvider, appState interface{},
	config config.Config, logger logrus.FieldLogger,
) ModuleInitParams

type ScanFn

type ScanFn func(k, v []byte) (bool, error)

type Storage

type Storage interface {
	Get(key []byte) ([]byte, error)
	Scan(scan ScanFn) error
	Put(key, value []byte) error
}

type StorageProvider

type StorageProvider interface {
	Storage(name string) (Storage, error)
	DataPath() string
}

Jump to

Keyboard shortcuts

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