modules

package
v1.19.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassBasedModuleConfig

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

func NewClassBasedModuleConfig

func NewClassBasedModuleConfig(class *models.Class,
	moduleName string,
) *ClassBasedModuleConfig

func (*ClassBasedModuleConfig) Class

func (cbmc *ClassBasedModuleConfig) Class() map[string]interface{}

func (*ClassBasedModuleConfig) ClassByModuleName

func (cbmc *ClassBasedModuleConfig) ClassByModuleName(moduleName string) map[string]interface{}

func (*ClassBasedModuleConfig) Property

func (cbmc *ClassBasedModuleConfig) Property(propName string) map[string]interface{}

type Provider

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

func NewProvider

func NewProvider() *Provider

func (*Provider) AggregateArguments

func (p *Provider) AggregateArguments(class *models.Class) map[string]*graphql.ArgumentConfig

AggregateArguments provides GraphQL Aggregate arguments

func (*Provider) BackupBackend

func (p *Provider) BackupBackend(backend string) (modulecapabilities.BackupBackend, error)

func (*Provider) CrossClassExtractSearchParams

func (p *Provider) CrossClassExtractSearchParams(arguments map[string]interface{}) map[string]interface{}

CrossClassExtractSearchParams extracts GraphQL arguments from modules without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) CrossClassValidateSearchParam

func (p *Provider) CrossClassValidateSearchParam(name string, value interface{}) error

CrossClassValidateSearchParam validates module parameters without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) CrossClassVectorFromSearchParam

func (p *Provider) CrossClassVectorFromSearchParam(ctx context.Context,
	param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn,
) ([]float32, error)

CrossClassVectorFromSearchParam gets a vector for a given argument without being specific to any one class and it's configuration. This is used in Explore() { } for example

func (*Provider) ExploreArguments

func (p *Provider) ExploreArguments(schema *models.Schema) map[string]*graphql.ArgumentConfig

ExploreArguments provides GraphQL Explore arguments

func (*Provider) ExtractAdditionalField

func (p *Provider) ExtractAdditionalField(className, name string, params []*ast.Argument) interface{}

ExtractAdditionalField extracts additional properties from given graphql arguments

func (*Provider) ExtractSearchParams

func (p *Provider) ExtractSearchParams(arguments map[string]interface{}, className string) map[string]interface{}

ExtractSearchParams extracts GraphQL arguments

func (*Provider) GetAdditionalFields

func (p *Provider) GetAdditionalFields(class *models.Class) map[string]*graphql.Field

GetAdditionalFields provides GraphQL Get additional fields

func (*Provider) GetAll

func (p *Provider) GetAll() []modulecapabilities.Module

func (*Provider) GetAllExclude

func (p *Provider) GetAllExclude(module string) []modulecapabilities.Module

func (*Provider) GetArguments

func (p *Provider) GetArguments(class *models.Class) map[string]*graphql.ArgumentConfig

GetArguments provides GraphQL Get arguments

func (*Provider) GetByName

func (p *Provider) GetByName(name string) modulecapabilities.Module

func (*Provider) GetClassificationFn

func (p *Provider) GetClassificationFn(className, name string,
	params modulecapabilities.ClassifyParams,
) (modulecapabilities.ClassifyItemFn, error)

GetClassificationFn returns given module's classification

func (*Provider) GetExploreAdditionalExtend

func (p *Provider) GetExploreAdditionalExtend(ctx context.Context, in []search.Result,
	moduleParams map[string]interface{}, searchVector []float32,
	argumentModuleParams map[string]interface{},
) ([]search.Result, error)

GetExploreAdditionalExtend extends graphql api get queries with additional properties

func (*Provider) GetMeta

func (p *Provider) GetMeta() (map[string]interface{}, error)

GetMeta returns meta information about modules

func (*Provider) GetObjectAdditionalExtend

func (p *Provider) GetObjectAdditionalExtend(ctx context.Context,
	in *search.Result, moduleParams map[string]interface{},
) (*search.Result, error)

GetObjectAdditionalExtend extends rest api get queries with additional properties

func (*Provider) GraphQLAdditionalFieldNames

func (p *Provider) GraphQLAdditionalFieldNames() []string

GraphQLAdditionalFieldNames get's all additional field names used in graphql

func (*Provider) HasMultipleVectorizers

func (p *Provider) HasMultipleVectorizers() bool

func (*Provider) Init

func (*Provider) ListExploreAdditionalExtend

func (p *Provider) ListExploreAdditionalExtend(ctx context.Context, in []search.Result,
	moduleParams map[string]interface{},
	argumentModuleParams map[string]interface{},
) ([]search.Result, error)

ListExploreAdditionalExtend extends graphql api list queries with additional properties

func (*Provider) ListObjectsAdditionalExtend

func (p *Provider) ListObjectsAdditionalExtend(ctx context.Context,
	in search.Results, moduleParams map[string]interface{},
) (search.Results, error)

ListObjectsAdditionalExtend extends rest api list queries with additional properties

func (*Provider) ParseClassifierSettings

func (p *Provider) ParseClassifierSettings(name string,
	params *models.Classification,
) error

ParseClassifierSettings parses and adds classifier specific settings

func (*Provider) Register

func (p *Provider) Register(mod modulecapabilities.Module)

func (*Provider) RestApiAdditionalProperties

func (p *Provider) RestApiAdditionalProperties(includeProp string, class *models.Class) map[string]interface{}

RestApiAdditionalProperties get's all rest specific additional properties with their default values

func (*Provider) SetClassDefaults

func (p *Provider) SetClassDefaults(class *models.Class)

SetClassDefaults sets the module-specific defaults for the class itself, but also for each prop

func (*Provider) SetSchemaGetter

func (p *Provider) SetSchemaGetter(sg schemaGetter)

func (*Provider) SetSinglePropertyDefaults

func (p *Provider) SetSinglePropertyDefaults(class *models.Class,
	prop *models.Property,
)

SetSinglePropertyDefaults can be used when a property is added later, e.g. as part of merging in a ref prop after a class has already been created

func (*Provider) UpdateVector

func (p *Provider) UpdateVector(ctx context.Context, object *models.Object, class *models.Class,
	objectDiff *moduletools.ObjectDiff, findObjectFn modulecapabilities.FindObjectFn,
	logger logrus.FieldLogger,
) error

func (*Provider) UsingRef2Vec

func (p *Provider) UsingRef2Vec(className string) bool

func (*Provider) ValidateClass

func (p *Provider) ValidateClass(ctx context.Context, class *models.Class) error

func (*Provider) ValidateSearchParam

func (p *Provider) ValidateSearchParam(name string, value interface{}, className string) error

ValidateSearchParam validates module parameters

func (*Provider) ValidateVectorizer

func (p *Provider) ValidateVectorizer(moduleName string) error

func (*Provider) VectorFromInput

func (p *Provider) VectorFromInput(ctx context.Context,
	className string, input string,
) ([]float32, error)

func (*Provider) VectorFromSearchParam

func (p *Provider) VectorFromSearchParam(ctx context.Context,
	className string, param string, params interface{},
	findVectorFn modulecapabilities.FindVectorFn,
) ([]float32, error)

VectorFromSearchParam gets a vector for a given argument. This is used in Get { Class() } for example

func (*Provider) VectorizerName

func (p *Provider) VectorizerName(className string) (string, error)

Jump to

Keyboard shortcuts

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