intercept

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudFileFunc added in v1.1.3

type CloudFileFunc func(context.Context, *ent.CloudFileQuery) (ent.Value, error)

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

func (CloudFileFunc) Query added in v1.1.3

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

Query calls f(ctx, q).

type CloudFileTagFunc added in v1.1.3

type CloudFileTagFunc func(context.Context, *ent.CloudFileTagQuery) (ent.Value, error)

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

func (CloudFileTagFunc) Query added in v1.1.3

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

Query calls f(ctx, q).

type FileFunc

type FileFunc func(context.Context, *ent.FileQuery) (ent.Value, error)

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

func (FileFunc) Query

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

Query calls f(ctx, q).

type FileTagFunc added in v1.1.3

type FileTagFunc func(context.Context, *ent.FileTagQuery) (ent.Value, error)

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

func (FileTagFunc) Query added in v1.1.3

func (f FileTagFunc) 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 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 StorageProviderFunc added in v1.1.3

type StorageProviderFunc func(context.Context, *ent.StorageProviderQuery) (ent.Value, error)

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

func (StorageProviderFunc) Query added in v1.1.3

Query calls f(ctx, q).

type TraverseCloudFile added in v1.1.3

type TraverseCloudFile func(context.Context, *ent.CloudFileQuery) error

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

func (TraverseCloudFile) Intercept added in v1.1.3

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

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

func (TraverseCloudFile) Traverse added in v1.1.3

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

Traverse calls f(ctx, q).

type TraverseCloudFileTag added in v1.1.3

type TraverseCloudFileTag func(context.Context, *ent.CloudFileTagQuery) error

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

func (TraverseCloudFileTag) Intercept added in v1.1.3

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

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

func (TraverseCloudFileTag) Traverse added in v1.1.3

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

Traverse calls f(ctx, q).

type TraverseFile

type TraverseFile func(context.Context, *ent.FileQuery) error

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

func (TraverseFile) Intercept

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

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

func (TraverseFile) Traverse

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

Traverse calls f(ctx, q).

type TraverseFileTag added in v1.1.3

type TraverseFileTag func(context.Context, *ent.FileTagQuery) error

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

func (TraverseFileTag) Intercept added in v1.1.3

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

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

func (TraverseFileTag) Traverse added in v1.1.3

func (f TraverseFileTag) 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 TraverseStorageProvider added in v1.1.3

type TraverseStorageProvider func(context.Context, *ent.StorageProviderQuery) error

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

func (TraverseStorageProvider) Intercept added in v1.1.3

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

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

func (TraverseStorageProvider) Traverse added in v1.1.3

Traverse calls f(ctx, q).

Jump to

Keyboard shortcuts

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