intercept

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressFunc

type AddressFunc func(context.Context, *ent.AddressQuery) (ent.Value, error)

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

func (AddressFunc) Query

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

Query calls f(ctx, q).

type AuditLogFunc

type AuditLogFunc func(context.Context, *ent.AuditLogQuery) (ent.Value, error)

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

func (AuditLogFunc) Query

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

Query calls f(ctx, q).

type BusinessFunc

type BusinessFunc func(context.Context, *ent.BusinessQuery) (ent.Value, error)

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

func (BusinessFunc) Query

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

Query calls f(ctx, q).

type ContentFunc

type ContentFunc func(context.Context, *ent.ContentQuery) (ent.Value, error)

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

func (ContentFunc) Query

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

type OperatorFunc func(context.Context, *ent.OperatorQuery) (ent.Value, error)

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

func (OperatorFunc) Query

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

type TagFunc func(context.Context, *ent.TagQuery) (ent.Value, error)

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

func (TagFunc) Query

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

Query calls f(ctx, q).

type TimetableFunc

type TimetableFunc func(context.Context, *ent.TimetableQuery) (ent.Value, error)

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

func (TimetableFunc) Query

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

Query calls f(ctx, q).

type TraverseAddress

type TraverseAddress func(context.Context, *ent.AddressQuery) error

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

func (TraverseAddress) Intercept

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

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

func (TraverseAddress) Traverse

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

Traverse calls f(ctx, q).

type TraverseAuditLog

type TraverseAuditLog func(context.Context, *ent.AuditLogQuery) error

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

func (TraverseAuditLog) Intercept

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

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

func (TraverseAuditLog) Traverse

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

Traverse calls f(ctx, q).

type TraverseBusiness

type TraverseBusiness func(context.Context, *ent.BusinessQuery) error

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

func (TraverseBusiness) Intercept

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

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

func (TraverseBusiness) Traverse

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

Traverse calls f(ctx, q).

type TraverseContent

type TraverseContent func(context.Context, *ent.ContentQuery) error

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

func (TraverseContent) Intercept

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

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

func (TraverseContent) Traverse

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

type TraverseOperator func(context.Context, *ent.OperatorQuery) error

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

func (TraverseOperator) Intercept

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

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

func (TraverseOperator) Traverse

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

Traverse calls f(ctx, q).

type TraverseTag

type TraverseTag func(context.Context, *ent.TagQuery) error

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

func (TraverseTag) Intercept

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

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

func (TraverseTag) Traverse

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

Traverse calls f(ctx, q).

type TraverseTimetable

type TraverseTimetable func(context.Context, *ent.TimetableQuery) error

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

func (TraverseTimetable) Intercept

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

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

func (TraverseTimetable) Traverse

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

Traverse calls f(ctx, q).

type TraverseUser

type TraverseUser func(context.Context, *ent.UserQuery) error

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

func (TraverseUser) Intercept

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

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

func (TraverseUser) Traverse

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

Traverse calls f(ctx, q).

type UserFunc

type UserFunc func(context.Context, *ent.UserQuery) (ent.Value, error)

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

func (UserFunc) Query

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

Query calls f(ctx, q).

Jump to

Keyboard shortcuts

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