moduletools

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 1 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

This section is empty.

Types

type ClassConfig

type ClassConfig interface {
	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) 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
}

func NewInitParams

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

type ObjectDiff

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

func NewObjectDiff

func NewObjectDiff(oldVec []float32) *ObjectDiff

func (*ObjectDiff) GetVec

func (od *ObjectDiff) GetVec() []float32

func (*ObjectDiff) IsChangedProp

func (od *ObjectDiff) IsChangedProp(propName string) bool

func (*ObjectDiff) WithProp

func (od *ObjectDiff) WithProp(propName string, oldValue, newValue interface{}) *ObjectDiff

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