intercept

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIFunc

type APIFunc func(context.Context, *ent.APIQuery) (ent.Value, error)

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

func (APIFunc) Query

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

Query calls f(ctx, q).

type DepartmentFunc

type DepartmentFunc func(context.Context, *ent.DepartmentQuery) (ent.Value, error)

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

func (DepartmentFunc) Query

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

Query calls f(ctx, q).

type DictionaryDetailFunc

type DictionaryDetailFunc func(context.Context, *ent.DictionaryDetailQuery) (ent.Value, error)

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

func (DictionaryDetailFunc) Query

Query calls f(ctx, q).

type DictionaryFunc

type DictionaryFunc func(context.Context, *ent.DictionaryQuery) (ent.Value, error)

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

func (DictionaryFunc) Query

func (f DictionaryFunc) 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 MenuFunc func(context.Context, *ent.MenuQuery) (ent.Value, error)

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

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

Query calls f(ctx, q).

type OauthProviderFunc

type OauthProviderFunc func(context.Context, *ent.OauthProviderQuery) (ent.Value, error)

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

func (OauthProviderFunc) Query

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

Query calls f(ctx, q).

type PositionFunc

type PositionFunc func(context.Context, *ent.PositionQuery) (ent.Value, error)

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

func (PositionFunc) Query

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

type RoleFunc func(context.Context, *ent.RoleQuery) (ent.Value, error)

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

func (RoleFunc) Query

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

Query calls f(ctx, q).

type TokenFunc

type TokenFunc func(context.Context, *ent.TokenQuery) (ent.Value, error)

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

func (TokenFunc) Query

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

Query calls f(ctx, q).

type TraverseAPI

type TraverseAPI func(context.Context, *ent.APIQuery) error

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

func (TraverseAPI) Intercept

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

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

func (TraverseAPI) Traverse

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

Traverse calls f(ctx, q).

type TraverseDepartment

type TraverseDepartment func(context.Context, *ent.DepartmentQuery) error

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

func (TraverseDepartment) Intercept

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

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

func (TraverseDepartment) Traverse

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

Traverse calls f(ctx, q).

type TraverseDictionary

type TraverseDictionary func(context.Context, *ent.DictionaryQuery) error

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

func (TraverseDictionary) Intercept

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

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

func (TraverseDictionary) Traverse

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

Traverse calls f(ctx, q).

type TraverseDictionaryDetail

type TraverseDictionaryDetail func(context.Context, *ent.DictionaryDetailQuery) error

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

func (TraverseDictionaryDetail) Intercept

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

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

func (TraverseDictionaryDetail) 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 TraverseMenu

type TraverseMenu func(context.Context, *ent.MenuQuery) error

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

func (TraverseMenu) Intercept

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

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

func (TraverseMenu) Traverse

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

Traverse calls f(ctx, q).

type TraverseOauthProvider

type TraverseOauthProvider func(context.Context, *ent.OauthProviderQuery) error

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

func (TraverseOauthProvider) Intercept

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

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

func (TraverseOauthProvider) Traverse

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

Traverse calls f(ctx, q).

type TraversePosition

type TraversePosition func(context.Context, *ent.PositionQuery) error

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

func (TraversePosition) Intercept

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

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

func (TraversePosition) Traverse

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

Traverse calls f(ctx, q).

type TraverseRole

type TraverseRole func(context.Context, *ent.RoleQuery) error

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

func (TraverseRole) Intercept

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

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

func (TraverseRole) Traverse

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

Traverse calls f(ctx, q).

type TraverseToken

type TraverseToken func(context.Context, *ent.TokenQuery) error

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

func (TraverseToken) Intercept

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

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

func (TraverseToken) Traverse

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