intercept

package
v0.0.0-...-22bdbfd Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 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 BrandFunc

type BrandFunc func(context.Context, *ent.BrandQuery) (ent.Value, error)

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

func (BrandFunc) Query

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

Query calls f(ctx, q).

type CategoryFunc

type CategoryFunc func(context.Context, *ent.CategoryQuery) (ent.Value, error)

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

func (CategoryFunc) Query

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

Query calls f(ctx, q).

type CommentFunc

type CommentFunc func(context.Context, *ent.CommentQuery) (ent.Value, error)

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

func (CommentFunc) Query

func (f CommentFunc) 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 PropertyFunc

type PropertyFunc func(context.Context, *ent.PropertyQuery) (ent.Value, error)

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

func (PropertyFunc) Query

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

Query calls f(ctx, q).

type PropertyValueFunc

type PropertyValueFunc func(context.Context, *ent.PropertyValueQuery) (ent.Value, error)

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

func (PropertyValueFunc) Query

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

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 SkuFunc

type SkuFunc func(context.Context, *ent.SkuQuery) (ent.Value, error)

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

func (SkuFunc) Query

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

Query calls f(ctx, q).

type SpuFunc

type SpuFunc func(context.Context, *ent.SpuQuery) (ent.Value, error)

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

func (SpuFunc) Query

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

Query calls f(ctx, q).

type TraverseBrand

type TraverseBrand func(context.Context, *ent.BrandQuery) error

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

func (TraverseBrand) Intercept

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

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

func (TraverseBrand) Traverse

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

Traverse calls f(ctx, q).

type TraverseCategory

type TraverseCategory func(context.Context, *ent.CategoryQuery) error

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

func (TraverseCategory) Intercept

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

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

func (TraverseCategory) Traverse

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

Traverse calls f(ctx, q).

type TraverseComment

type TraverseComment func(context.Context, *ent.CommentQuery) error

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

func (TraverseComment) Intercept

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

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

func (TraverseComment) Traverse

func (f TraverseComment) 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 TraverseProperty

type TraverseProperty func(context.Context, *ent.PropertyQuery) error

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

func (TraverseProperty) Intercept

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

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

func (TraverseProperty) Traverse

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

Traverse calls f(ctx, q).

type TraversePropertyValue

type TraversePropertyValue func(context.Context, *ent.PropertyValueQuery) error

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

func (TraversePropertyValue) Intercept

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

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

func (TraversePropertyValue) Traverse

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

Traverse calls f(ctx, q).

type TraverseSku

type TraverseSku func(context.Context, *ent.SkuQuery) error

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

func (TraverseSku) Intercept

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

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

func (TraverseSku) Traverse

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

Traverse calls f(ctx, q).

type TraverseSpu

type TraverseSpu func(context.Context, *ent.SpuQuery) error

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

func (TraverseSpu) Intercept

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

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

func (TraverseSpu) Traverse

func (f TraverseSpu) 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