engine

package module
v0.0.518 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 28 Imported by: 5

README

Engine 📦

Fabriktor Logo

GitLab stars

Go Reference License Go Report Card Tag Badge GitLab last commit Pipeline Badge

Overview

This package is designed exclusively for Fabriktor's operational needs and is not intended for public usage.

Refer to the Go Reference for detailed API documentation and examples.

License

This project is licensed under the Apache License 2.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOne added in v0.0.6

DeleteOne handles a delete-one operation using a transaction.

func FindMany added in v0.0.6

FindMany handles a find-many operation using a transaction.

func FindOne added in v0.0.6

FindOne handles a find-one operation using a transaction.

func HDeleteOne added in v0.0.116

HDeleteOne contains the inner logic for a delete-one operation.

func HInsertOne added in v0.0.116

HInsertOne contains the inner logic for an insert-one operation.

func HPull added in v0.0.428

func HReplaceOne added in v0.0.116

HReplaceOne contains the inner logic for a replace-one operation.

func HSearchMany added in v0.0.116

HSearchMany contains the inner logic for a search-many operation.

func HUpsertOne added in v0.0.385

HUpsertOne contains the inner logic for an upsert-one operation.

func InsertOne added in v0.0.6

InsertOne handles an insert-one operation using a transaction.

func NotFound added in v0.0.6

func NotFound(t *toolbox.Toolbox) contract.HandlerFunc

NotFound handles a not-found operation.

func Pull added in v0.0.428

Pull handles a pull operation for vector matching within a session.

func Query added in v0.0.104

Query handles a find-many operation using query parameters and a transaction.

func RecsToAny added in v0.0.115

func RecsToAny(v []Record) []any

RecsToAny converts a slice of Records to a slice of any.

func RecsToIdtfs added in v0.0.115

func RecsToIdtfs(v []Record) []contract.Identifiable

RecsToIdtfs converts a slice of Records to Identifiables.

func RecsToPullSessions added in v0.0.428

func RecsToPullSessions(v []Record) ([]contract.PullSession, error)

RecsToPullSessions converts a slice of Records to PullSessions.

func ReplaceOne added in v0.0.6

ReplaceOne handles a replace-one operation using a transaction.

func SearchMany added in v0.0.6

SearchMany handles a search-many operation.

func Swagger added in v0.0.6

func Swagger(t *toolbox.Toolbox) contract.HandlerFunc

Swagger serves the Redoc UI for API docs.

func SwaggerR added in v0.0.10

func SwaggerR(t *toolbox.Toolbox) contract.HandlerFunc

SwaggerR serves the raw Swagger file.

func UpsertOne added in v0.0.385

UpsertOne handles an upsert-one operation using a transaction.

Types

type CleanFunc added in v0.0.410

type CleanFunc func(ctx context.Context, t *toolbox.Toolbox, opts CleanOptions) (Record, error)

func CleanAs added in v0.0.410

func CleanAs[T any](fn func(*T) error) CleanFunc

CleanAs adapts a typed pointer mutator into a CleanFunc (no-op for non-matching types).

type CleanOption added in v0.0.410

type CleanOption = contract.Opt[CleanOptions]

func WithCleanRecord added in v0.0.410

func WithCleanRecord(x Record) CleanOption

func WithCleanRequest added in v0.0.410

func WithCleanRequest(x *http.Request) CleanOption

func WithCleanVars added in v0.0.411

func WithCleanVars(x *configpkg.Vars) CleanOption

type CleanOptions added in v0.0.410

type CleanOptions struct {
	R    *http.Request
	V    Record
	Vars *configpkg.Vars
}

func ApplyCleanOptions added in v0.0.410

func ApplyCleanOptions(opts *CleanOptions, modifiers ...CleanOption) CleanOptions

type Cleaners added in v0.0.410

type Cleaners []CleanFunc

type Client

type Client interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	PurgeTestDB(ctx context.Context) error
}

func NewEngine

func NewEngine(opts ClientOptions) (Client, error)

type ClientOption

type ClientOption = contract.Opt[ClientOptions]

func WithNotFoundHandler added in v0.0.164

func WithNotFoundHandler(x contract.HandlerFunc) ClientOption

func WithPurgeTestDBOptions added in v0.0.201

func WithPurgeTestDBOptions(x []contract.CreateCollectionsOptions) ClientOption

func WithRoutes added in v0.0.6

func WithRoutes(x []*contract.Route) ClientOption

func WithToolbox

func WithToolbox(x *toolbox.Toolbox) ClientOption

type ClientOptions

type ClientOptions struct {
	T               *toolbox.Toolbox
	R               []*contract.Route
	NotFoundHandler contract.HandlerFunc
	P               []contract.CreateCollectionsOptions
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type CollateralFunc added in v0.0.260

type CollateralFunc func(ctx context.Context, t *toolbox.Toolbox, opts CollateralOptions) error

type CollateralOption added in v0.0.260

type CollateralOption = contract.Opt[CollateralOptions]

func WithCollateralRecord added in v0.0.261

func WithCollateralRecord(x Record) CollateralOption

func WithCollateralRequest added in v0.0.260

func WithCollateralRequest(x *http.Request) CollateralOption

type CollateralOptions added in v0.0.260

type CollateralOptions struct {
	R *http.Request
	V Record
}

func ApplyCollateralOptions added in v0.0.260

func ApplyCollateralOptions(opts *CollateralOptions, modifiers ...CollateralOption) CollateralOptions

type Collaterals added in v0.0.260

type Collaterals []CollateralFunc

Collaterals always run after the handler finishes its normal DB/write cycle. To write again, do it inside the collateral.

type Computable added in v0.0.215

type Computable interface {
	Compute(ctx context.Context, opts ComputeOptions) error
}

type ComputeOption added in v0.0.259

type ComputeOption = contract.Opt[ComputeOptions]

func WithComputeMethod added in v0.0.259

func WithComputeMethod(x string) ComputeOption

func WithComputeRequest added in v0.0.259

func WithComputeRequest(x *http.Request) ComputeOption

func WithComputeToolbox added in v0.0.259

func WithComputeToolbox(x *toolbox.Toolbox) ComputeOption

type ComputeOptions added in v0.0.259

type ComputeOptions struct {
	T      *toolbox.Toolbox
	R      *http.Request
	Method string
}

func ApplyComputeOptions added in v0.0.259

func ApplyComputeOptions(opts *ComputeOptions, modifiers ...ComputeOption) ComputeOptions

type Record added in v0.0.7

func HFindMany added in v0.0.116

HFindMany contains the inner logic for a find-many operation.

func HFindOne added in v0.0.116

HFindOne contains the inner logic for a find-one operation.

func IdtfsToRecs added in v0.0.115

func IdtfsToRecs(v []contract.Identifiable) ([]Record, error)

IdtfsToRecs converts a slice of Identifiables to Records.

func ToRec added in v0.0.115

func ToRec(v any) (Record, error)

ToRec asserts a value to a Record.

func ToRecs added in v0.0.115

func ToRecs(v []any) ([]Record, error)

ToRecs converts a slice of any to a slice of Records.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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