intercept

package
v1.99.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleFunc

type BundleFunc func(context.Context, *ent.BundleQuery) (ent.Value, error)

The BundleFunc type is an adapter to allow the use of ordinary function as a Querier.

func (BundleFunc) Query

func (f BundleFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error)

Query calls f(ctx, q).

type Func

type Func func(context.Context, Query) error

The Func type is an adapter that allows ordinary functions to be used as interceptors. Unlike traversal functions, interceptors are skipped during graph traversals. Note that the implementation of Func is different from the one defined in entgo.io/ent.InterceptFunc.

func (Func) Intercept

func (f Func) Intercept(next ent.Querier) ent.Querier

Intercept calls f(ctx, q) and then applied the next Querier.

type InvoiceFunc

type InvoiceFunc func(context.Context, *ent.InvoiceQuery) (ent.Value, error)

The InvoiceFunc type is an adapter to allow the use of ordinary function as a Querier.

func (InvoiceFunc) Query

func (f InvoiceFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error)

Query calls f(ctx, q).

type ItemFunc

type ItemFunc func(context.Context, *ent.ItemQuery) (ent.Value, error)

The ItemFunc type is an adapter to allow the use of ordinary function as a Querier.

func (ItemFunc) Query

func (f ItemFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error)

Query calls f(ctx, q).

type PaymentProfileFunc

type PaymentProfileFunc func(context.Context, *ent.PaymentProfileQuery) (ent.Value, error)

The PaymentProfileFunc type is an adapter to allow the use of ordinary function as a Querier.

func (PaymentProfileFunc) Query

Query calls f(ctx, q).

type ProductFunc

type ProductFunc func(context.Context, *ent.ProductQuery) (ent.Value, error)

The ProductFunc type is an adapter to allow the use of ordinary function as a Querier.

func (ProductFunc) Query

func (f ProductFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error)

Query calls f(ctx, q).

type ProductReservationFunc

type ProductReservationFunc func(context.Context, *ent.ProductReservationQuery) (ent.Value, error)

The ProductReservationFunc type is an adapter to allow the use of ordinary function as a Querier.

func (ProductReservationFunc) Query

Query calls f(ctx, q).

type Query

type Query interface {
	// Type returns the string representation of the query type.
	Type() string
	// Limit the number of records to be returned by this query.
	Limit(int)
	// Offset to start from.
	Offset(int)
	// Unique configures the query builder to filter duplicate records.
	Unique(bool)
	// Order specifies how the records should be ordered.
	Order(...func(*sql.Selector))
	// WhereP appends storage-level predicates to the query builder. Using this method, users
	// can use type-assertion to append predicates that do not depend on any generated package.
	WhereP(...func(*sql.Selector))
}

The Query interface represents an operation that queries a graph. By using this interface, users can write generic code that manipulates query builders of different types.

func NewQuery

func NewQuery(q ent.Query) (Query, error)

NewQuery returns the generic Query interface for the given typed query.

type SubscriptionsFunc

type SubscriptionsFunc func(context.Context, *ent.SubscriptionsQuery) (ent.Value, error)

The SubscriptionsFunc type is an adapter to allow the use of ordinary function as a Querier.

func (SubscriptionsFunc) Query

func (f SubscriptionsFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error)

Query calls f(ctx, q).

type TraverseBundle

type TraverseBundle func(context.Context, *ent.BundleQuery) error

The TraverseBundle type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseBundle) Intercept

func (f TraverseBundle) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseBundle) Traverse

func (f TraverseBundle) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraverseFunc

type TraverseFunc func(context.Context, Query) error

The TraverseFunc type is an adapter to allow the use of ordinary function as Traverser. If f is a function with the appropriate signature, TraverseFunc(f) is a Traverser that calls f.

func (TraverseFunc) Intercept

func (f TraverseFunc) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseFunc) Traverse

func (f TraverseFunc) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraverseInvoice

type TraverseInvoice func(context.Context, *ent.InvoiceQuery) error

The TraverseInvoice type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseInvoice) Intercept

func (f TraverseInvoice) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseInvoice) Traverse

func (f TraverseInvoice) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraverseItem

type TraverseItem func(context.Context, *ent.ItemQuery) error

The TraverseItem type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseItem) Intercept

func (f TraverseItem) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseItem) Traverse

func (f TraverseItem) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraversePaymentProfile

type TraversePaymentProfile func(context.Context, *ent.PaymentProfileQuery) error

The TraversePaymentProfile type is an adapter to allow the use of ordinary function as Traverser.

func (TraversePaymentProfile) Intercept

func (f TraversePaymentProfile) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraversePaymentProfile) Traverse

func (f TraversePaymentProfile) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraverseProduct

type TraverseProduct func(context.Context, *ent.ProductQuery) error

The TraverseProduct type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseProduct) Intercept

func (f TraverseProduct) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseProduct) Traverse

func (f TraverseProduct) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

type TraverseProductReservation

type TraverseProductReservation func(context.Context, *ent.ProductReservationQuery) error

The TraverseProductReservation type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseProductReservation) Intercept

func (f TraverseProductReservation) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseProductReservation) Traverse

Traverse calls f(ctx, q).

type TraverseSubscriptions

type TraverseSubscriptions func(context.Context, *ent.SubscriptionsQuery) error

The TraverseSubscriptions type is an adapter to allow the use of ordinary function as Traverser.

func (TraverseSubscriptions) Intercept

func (f TraverseSubscriptions) Intercept(next ent.Querier) ent.Querier

Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.

func (TraverseSubscriptions) Traverse

func (f TraverseSubscriptions) Traverse(ctx context.Context, q ent.Query) error

Traverse calls f(ctx, q).

Jump to

Keyboard shortcuts

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