intercept

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationFunc

type AnnotationFunc func(context.Context, *ent.AnnotationQuery) (ent.Value, error)

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

func (AnnotationFunc) Query

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

Query calls f(ctx, q).

type DocumentFunc

type DocumentFunc func(context.Context, *ent.DocumentQuery) (ent.Value, error)

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

func (DocumentFunc) Query

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

Query calls f(ctx, q).

type DocumentTypeFunc

type DocumentTypeFunc func(context.Context, *ent.DocumentTypeQuery) (ent.Value, error)

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

func (DocumentTypeFunc) Query

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

Query calls f(ctx, q).

type EdgeTypeFunc

type EdgeTypeFunc func(context.Context, *ent.EdgeTypeQuery) (ent.Value, error)

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

func (EdgeTypeFunc) Query

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

Query calls f(ctx, q).

type ExternalReferenceFunc

type ExternalReferenceFunc func(context.Context, *ent.ExternalReferenceQuery) (ent.Value, error)

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

func (ExternalReferenceFunc) Query

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 HashesEntryFunc

type HashesEntryFunc func(context.Context, *ent.HashesEntryQuery) (ent.Value, error)

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

func (HashesEntryFunc) Query

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

Query calls f(ctx, q).

type IdentifiersEntryFunc

type IdentifiersEntryFunc func(context.Context, *ent.IdentifiersEntryQuery) (ent.Value, error)

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

func (IdentifiersEntryFunc) Query

Query calls f(ctx, q).

type MetadataFunc

type MetadataFunc func(context.Context, *ent.MetadataQuery) (ent.Value, error)

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

func (MetadataFunc) Query

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

Query calls f(ctx, q).

type NodeFunc

type NodeFunc func(context.Context, *ent.NodeQuery) (ent.Value, error)

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

func (NodeFunc) Query

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

Query calls f(ctx, q).

type NodeListFunc

type NodeListFunc func(context.Context, *ent.NodeListQuery) (ent.Value, error)

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

func (NodeListFunc) Query

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

Query calls f(ctx, q).

type PersonFunc

type PersonFunc func(context.Context, *ent.PersonQuery) (ent.Value, error)

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

func (PersonFunc) Query

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

Query calls f(ctx, q).

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 PurposeFunc

type PurposeFunc func(context.Context, *ent.PurposeQuery) (ent.Value, error)

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

func (PurposeFunc) Query

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

type SourceDataFunc func(context.Context, *ent.SourceDataQuery) (ent.Value, error)

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

func (SourceDataFunc) Query

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

Query calls f(ctx, q).

type ToolFunc

type ToolFunc func(context.Context, *ent.ToolQuery) (ent.Value, error)

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

func (ToolFunc) Query

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

Query calls f(ctx, q).

type TraverseAnnotation

type TraverseAnnotation func(context.Context, *ent.AnnotationQuery) error

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

func (TraverseAnnotation) Intercept

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

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

func (TraverseAnnotation) Traverse

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

Traverse calls f(ctx, q).

type TraverseDocument

type TraverseDocument func(context.Context, *ent.DocumentQuery) error

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

func (TraverseDocument) Intercept

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

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

func (TraverseDocument) Traverse

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

Traverse calls f(ctx, q).

type TraverseDocumentType

type TraverseDocumentType func(context.Context, *ent.DocumentTypeQuery) error

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

func (TraverseDocumentType) Intercept

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

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

func (TraverseDocumentType) Traverse

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

Traverse calls f(ctx, q).

type TraverseEdgeType

type TraverseEdgeType func(context.Context, *ent.EdgeTypeQuery) error

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

func (TraverseEdgeType) Intercept

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

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

func (TraverseEdgeType) Traverse

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

Traverse calls f(ctx, q).

type TraverseExternalReference

type TraverseExternalReference func(context.Context, *ent.ExternalReferenceQuery) error

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

func (TraverseExternalReference) Intercept

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

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

func (TraverseExternalReference) Traverse

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 TraverseHashesEntry

type TraverseHashesEntry func(context.Context, *ent.HashesEntryQuery) error

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

func (TraverseHashesEntry) Intercept

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

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

func (TraverseHashesEntry) Traverse

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

Traverse calls f(ctx, q).

type TraverseIdentifiersEntry

type TraverseIdentifiersEntry func(context.Context, *ent.IdentifiersEntryQuery) error

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

func (TraverseIdentifiersEntry) Intercept

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

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

func (TraverseIdentifiersEntry) Traverse

Traverse calls f(ctx, q).

type TraverseMetadata

type TraverseMetadata func(context.Context, *ent.MetadataQuery) error

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

func (TraverseMetadata) Intercept

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

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

func (TraverseMetadata) Traverse

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

Traverse calls f(ctx, q).

type TraverseNode

type TraverseNode func(context.Context, *ent.NodeQuery) error

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

func (TraverseNode) Intercept

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

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

func (TraverseNode) Traverse

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

Traverse calls f(ctx, q).

type TraverseNodeList

type TraverseNodeList func(context.Context, *ent.NodeListQuery) error

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

func (TraverseNodeList) Intercept

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

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

func (TraverseNodeList) Traverse

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

Traverse calls f(ctx, q).

type TraversePerson

type TraversePerson func(context.Context, *ent.PersonQuery) error

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

func (TraversePerson) Intercept

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

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

func (TraversePerson) Traverse

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

type TraversePurpose func(context.Context, *ent.PurposeQuery) error

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

func (TraversePurpose) Intercept

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

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

func (TraversePurpose) Traverse

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

Traverse calls f(ctx, q).

type TraverseSourceData

type TraverseSourceData func(context.Context, *ent.SourceDataQuery) error

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

func (TraverseSourceData) Intercept

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

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

func (TraverseSourceData) Traverse

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

Traverse calls f(ctx, q).

type TraverseTool

type TraverseTool func(context.Context, *ent.ToolQuery) error

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

func (TraverseTool) Intercept

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

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

func (TraverseTool) Traverse

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