engine

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New creates a new engine manager

Types

type Dummy

type Dummy struct {
	DataSource api.DataSource
	api.RuntimeManager
}

func (*Dummy) Append

func (*Dummy) Append(ctx context.Context, FQN string, keys api.Keys, val any, ts time.Time) error

func (*Dummy) FeatureDescriptor

func (*Dummy) FeatureDescriptor(ctx context.Context, selector string) (api.FeatureDescriptor, error)

func (*Dummy) Get

func (*Dummy) Get(ctx context.Context, selector string, keys api.Keys) (api.Value, api.FeatureDescriptor, error)

func (*Dummy) GetDataSource

func (d *Dummy) GetDataSource(_ string) (api.DataSource, error)

func (*Dummy) Incr

func (*Dummy) Incr(ctx context.Context, FQN string, keys api.Keys, by any, ts time.Time) error

func (*Dummy) Set

func (*Dummy) Set(ctx context.Context, FQN string, keys api.Keys, val any, ts time.Time) error

func (*Dummy) Update

func (*Dummy) Update(ctx context.Context, FQN string, keys api.Keys, val any, ts time.Time) error

type FeaturePipeliner

type FeaturePipeliner struct {
	api.FeatureDescriptor
	// contains filtered or unexported fields
}

FeaturePipeliner is a Core's engine feature abstraction. It contains the FD and the pipelines.

func FeatureWithEngine

func FeatureWithEngine(e api.ExtendedManager, in *manifests.Feature) (*FeaturePipeliner, error)

FeatureWithEngine converts the k8s manifests.Feature CRD to the internal engine implementation and wraps it in a pipeliner. This is useful as a standalone function for validating features.

func (*FeaturePipeliner) AddPostGetMiddleware

func (f *FeaturePipeliner) AddPostGetMiddleware(priority int, fn api.Middleware)

AddPostGetMiddleware adds a post-get hook to the feature abstraction.

func (*FeaturePipeliner) AddPostSetMiddleware

func (f *FeaturePipeliner) AddPostSetMiddleware(priority int, fn api.Middleware)

AddPostSetMiddleware adds a post-set hook to the feature abstraction.

func (*FeaturePipeliner) AddPreGetMiddleware

func (f *FeaturePipeliner) AddPreGetMiddleware(priority int, fn api.Middleware)

AddPreGetMiddleware adds a pre-get hook to the feature abstraction.

func (*FeaturePipeliner) AddPreSetMiddleware

func (f *FeaturePipeliner) AddPreSetMiddleware(priority int, fn api.Middleware)

AddPreSetMiddleware adds a pre-set hook to the feature abstraction.

func (*FeaturePipeliner) Context

func (f *FeaturePipeliner) Context(ctx context.Context, selector string, logger logr.Logger) (context.Context, context.CancelFunc, error)

Context returns a new context with the feature attached.

type Middlewares

type Middlewares []api.Middleware

type Pipeline

type Pipeline struct {
	Middlewares
	api.FeatureDescriptor
}

func (Pipeline) Apply

func (p Pipeline) Apply(ctx context.Context, keys api.Keys, first api.Value) (api.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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