intercept

package
v0.0.0-...-fe50809 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrencyFunc

type CurrencyFunc func(context.Context, *entities.CurrencyQuery) (entities.Value, error)

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

func (CurrencyFunc) 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 entities.Querier) entities.Querier

Intercept calls f(ctx, q) and then applied the next Querier.

type MarketFunc

type MarketFunc func(context.Context, *entities.MarketQuery) (entities.Value, error)

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

func (MarketFunc) Query

Query calls f(ctx, q).

type OutboxFunc

type OutboxFunc func(context.Context, *entities.OutboxQuery) (entities.Value, error)

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

func (OutboxFunc) Query

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(...entities.OrderFunc)
	// 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 entities.Query) (Query, error)

NewQuery returns the generic Query interface for the given typed query.

type TickerFunc

type TickerFunc func(context.Context, *entities.TickerQuery) (entities.Value, error)

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

func (TickerFunc) Query

Query calls f(ctx, q).

type TradingPairFunc

type TradingPairFunc func(context.Context, *entities.TradingPairQuery) (entities.Value, error)

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

func (TradingPairFunc) Query

Query calls f(ctx, q).

type TraverseCurrency

type TraverseCurrency func(context.Context, *entities.CurrencyQuery) error

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

func (TraverseCurrency) Intercept

func (f TraverseCurrency) Intercept(next entities.Querier) entities.Querier

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

func (TraverseCurrency) Traverse

func (f TraverseCurrency) Traverse(ctx context.Context, q entities.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 entities.Querier) entities.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 entities.Query) error

Traverse calls f(ctx, q).

type TraverseMarket

type TraverseMarket func(context.Context, *entities.MarketQuery) error

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

func (TraverseMarket) Intercept

func (f TraverseMarket) Intercept(next entities.Querier) entities.Querier

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

func (TraverseMarket) Traverse

func (f TraverseMarket) Traverse(ctx context.Context, q entities.Query) error

Traverse calls f(ctx, q).

type TraverseOutbox

type TraverseOutbox func(context.Context, *entities.OutboxQuery) error

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

func (TraverseOutbox) Intercept

func (f TraverseOutbox) Intercept(next entities.Querier) entities.Querier

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

func (TraverseOutbox) Traverse

func (f TraverseOutbox) Traverse(ctx context.Context, q entities.Query) error

Traverse calls f(ctx, q).

type TraverseTicker

type TraverseTicker func(context.Context, *entities.TickerQuery) error

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

func (TraverseTicker) Intercept

func (f TraverseTicker) Intercept(next entities.Querier) entities.Querier

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

func (TraverseTicker) Traverse

func (f TraverseTicker) Traverse(ctx context.Context, q entities.Query) error

Traverse calls f(ctx, q).

type TraverseTradingPair

type TraverseTradingPair func(context.Context, *entities.TradingPairQuery) error

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

func (TraverseTradingPair) Intercept

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

func (TraverseTradingPair) Traverse

Traverse calls f(ctx, q).

type TraverseVenue

type TraverseVenue func(context.Context, *entities.VenueQuery) error

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

func (TraverseVenue) Intercept

func (f TraverseVenue) Intercept(next entities.Querier) entities.Querier

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

func (TraverseVenue) Traverse

func (f TraverseVenue) Traverse(ctx context.Context, q entities.Query) error

Traverse calls f(ctx, q).

type VenueFunc

type VenueFunc func(context.Context, *entities.VenueQuery) (entities.Value, error)

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

func (VenueFunc) Query

Query calls f(ctx, q).

Jump to

Keyboard shortcuts

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