intercept

package
v0.3.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatalogFunc

type CatalogFunc func(context.Context, *model.CatalogQuery) (model.Value, error)

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

func (CatalogFunc) Query

func (f CatalogFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type ConnectorFunc

type ConnectorFunc func(context.Context, *model.ConnectorQuery) (model.Value, error)

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

func (ConnectorFunc) Query

func (f ConnectorFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type CostReportFunc

type CostReportFunc func(context.Context, *model.CostReportQuery) (model.Value, error)

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

func (CostReportFunc) Query

Query calls f(ctx, q).

type DistributeLockFunc

type DistributeLockFunc func(context.Context, *model.DistributeLockQuery) (model.Value, error)

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

func (DistributeLockFunc) Query

Query calls f(ctx, q).

type EnvironmentConnectorRelationshipFunc

type EnvironmentConnectorRelationshipFunc func(context.Context, *model.EnvironmentConnectorRelationshipQuery) (model.Value, error)

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

func (EnvironmentConnectorRelationshipFunc) Query

Query calls f(ctx, q).

type EnvironmentFunc

type EnvironmentFunc func(context.Context, *model.EnvironmentQuery) (model.Value, error)

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

func (EnvironmentFunc) 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 model.Querier) model.Querier

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

type PerspectiveFunc

type PerspectiveFunc func(context.Context, *model.PerspectiveQuery) (model.Value, error)

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

func (PerspectiveFunc) Query

Query calls f(ctx, q).

type ProjectFunc

type ProjectFunc func(context.Context, *model.ProjectQuery) (model.Value, error)

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

func (ProjectFunc) Query

func (f ProjectFunc) Query(ctx context.Context, q model.Query) (model.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 model.Query) (Query, error)

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

type RoleFunc

type RoleFunc func(context.Context, *model.RoleQuery) (model.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 model.Query) (model.Value, error)

Query calls f(ctx, q).

type ServiceFunc

type ServiceFunc func(context.Context, *model.ServiceQuery) (model.Value, error)

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

func (ServiceFunc) Query

func (f ServiceFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type ServiceRelationshipFunc

type ServiceRelationshipFunc func(context.Context, *model.ServiceRelationshipQuery) (model.Value, error)

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

func (ServiceRelationshipFunc) Query

Query calls f(ctx, q).

type ServiceResourceFunc

type ServiceResourceFunc func(context.Context, *model.ServiceResourceQuery) (model.Value, error)

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

func (ServiceResourceFunc) Query

Query calls f(ctx, q).

type ServiceResourceRelationshipFunc

type ServiceResourceRelationshipFunc func(context.Context, *model.ServiceResourceRelationshipQuery) (model.Value, error)

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

func (ServiceResourceRelationshipFunc) Query

Query calls f(ctx, q).

type ServiceRevisionFunc

type ServiceRevisionFunc func(context.Context, *model.ServiceRevisionQuery) (model.Value, error)

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

func (ServiceRevisionFunc) Query

Query calls f(ctx, q).

type SettingFunc

type SettingFunc func(context.Context, *model.SettingQuery) (model.Value, error)

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

func (SettingFunc) Query

func (f SettingFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type SubjectFunc

type SubjectFunc func(context.Context, *model.SubjectQuery) (model.Value, error)

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

func (SubjectFunc) Query

func (f SubjectFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type SubjectRoleRelationshipFunc

type SubjectRoleRelationshipFunc func(context.Context, *model.SubjectRoleRelationshipQuery) (model.Value, error)

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

func (SubjectRoleRelationshipFunc) Query

Query calls f(ctx, q).

type TemplateFunc

type TemplateFunc func(context.Context, *model.TemplateQuery) (model.Value, error)

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

func (TemplateFunc) Query

func (f TemplateFunc) Query(ctx context.Context, q model.Query) (model.Value, error)

Query calls f(ctx, q).

type TemplateVersionFunc

type TemplateVersionFunc func(context.Context, *model.TemplateVersionQuery) (model.Value, error)

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

func (TemplateVersionFunc) Query

Query calls f(ctx, q).

type TokenFunc

type TokenFunc func(context.Context, *model.TokenQuery) (model.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 model.Query) (model.Value, error)

Query calls f(ctx, q).

type TraverseCatalog

type TraverseCatalog func(context.Context, *model.CatalogQuery) error

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

func (TraverseCatalog) Intercept

func (f TraverseCatalog) Intercept(next model.Querier) model.Querier

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

func (TraverseCatalog) Traverse

func (f TraverseCatalog) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseConnector

type TraverseConnector func(context.Context, *model.ConnectorQuery) error

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

func (TraverseConnector) Intercept

func (f TraverseConnector) Intercept(next model.Querier) model.Querier

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

func (TraverseConnector) Traverse

func (f TraverseConnector) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseCostReport

type TraverseCostReport func(context.Context, *model.CostReportQuery) error

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

func (TraverseCostReport) Intercept

func (f TraverseCostReport) Intercept(next model.Querier) model.Querier

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

func (TraverseCostReport) Traverse

func (f TraverseCostReport) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseDistributeLock

type TraverseDistributeLock func(context.Context, *model.DistributeLockQuery) error

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

func (TraverseDistributeLock) Intercept

func (f TraverseDistributeLock) Intercept(next model.Querier) model.Querier

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

func (TraverseDistributeLock) Traverse

Traverse calls f(ctx, q).

type TraverseEnvironment

type TraverseEnvironment func(context.Context, *model.EnvironmentQuery) error

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

func (TraverseEnvironment) Intercept

func (f TraverseEnvironment) Intercept(next model.Querier) model.Querier

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

func (TraverseEnvironment) Traverse

func (f TraverseEnvironment) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseEnvironmentConnectorRelationship

type TraverseEnvironmentConnectorRelationship func(context.Context, *model.EnvironmentConnectorRelationshipQuery) error

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

func (TraverseEnvironmentConnectorRelationship) Intercept

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

func (TraverseEnvironmentConnectorRelationship) 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 model.Querier) model.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 model.Query) error

Traverse calls f(ctx, q).

type TraversePerspective

type TraversePerspective func(context.Context, *model.PerspectiveQuery) error

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

func (TraversePerspective) Intercept

func (f TraversePerspective) Intercept(next model.Querier) model.Querier

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

func (TraversePerspective) Traverse

func (f TraversePerspective) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseProject

type TraverseProject func(context.Context, *model.ProjectQuery) error

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

func (TraverseProject) Intercept

func (f TraverseProject) Intercept(next model.Querier) model.Querier

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

func (TraverseProject) Traverse

func (f TraverseProject) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseRole

type TraverseRole func(context.Context, *model.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 model.Querier) model.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 model.Query) error

Traverse calls f(ctx, q).

type TraverseService

type TraverseService func(context.Context, *model.ServiceQuery) error

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

func (TraverseService) Intercept

func (f TraverseService) Intercept(next model.Querier) model.Querier

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

func (TraverseService) Traverse

func (f TraverseService) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseServiceRelationship

type TraverseServiceRelationship func(context.Context, *model.ServiceRelationshipQuery) error

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

func (TraverseServiceRelationship) Intercept

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

func (TraverseServiceRelationship) Traverse

Traverse calls f(ctx, q).

type TraverseServiceResource

type TraverseServiceResource func(context.Context, *model.ServiceResourceQuery) error

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

func (TraverseServiceResource) Intercept

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

func (TraverseServiceResource) Traverse

Traverse calls f(ctx, q).

type TraverseServiceResourceRelationship

type TraverseServiceResourceRelationship func(context.Context, *model.ServiceResourceRelationshipQuery) error

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

func (TraverseServiceResourceRelationship) Intercept

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

func (TraverseServiceResourceRelationship) Traverse

Traverse calls f(ctx, q).

type TraverseServiceRevision

type TraverseServiceRevision func(context.Context, *model.ServiceRevisionQuery) error

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

func (TraverseServiceRevision) Intercept

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

func (TraverseServiceRevision) Traverse

Traverse calls f(ctx, q).

type TraverseSetting

type TraverseSetting func(context.Context, *model.SettingQuery) error

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

func (TraverseSetting) Intercept

func (f TraverseSetting) Intercept(next model.Querier) model.Querier

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

func (TraverseSetting) Traverse

func (f TraverseSetting) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseSubject

type TraverseSubject func(context.Context, *model.SubjectQuery) error

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

func (TraverseSubject) Intercept

func (f TraverseSubject) Intercept(next model.Querier) model.Querier

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

func (TraverseSubject) Traverse

func (f TraverseSubject) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseSubjectRoleRelationship

type TraverseSubjectRoleRelationship func(context.Context, *model.SubjectRoleRelationshipQuery) error

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

func (TraverseSubjectRoleRelationship) Intercept

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

func (TraverseSubjectRoleRelationship) Traverse

Traverse calls f(ctx, q).

type TraverseTemplate

type TraverseTemplate func(context.Context, *model.TemplateQuery) error

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

func (TraverseTemplate) Intercept

func (f TraverseTemplate) Intercept(next model.Querier) model.Querier

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

func (TraverseTemplate) Traverse

func (f TraverseTemplate) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type TraverseTemplateVersion

type TraverseTemplateVersion func(context.Context, *model.TemplateVersionQuery) error

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

func (TraverseTemplateVersion) Intercept

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

func (TraverseTemplateVersion) Traverse

Traverse calls f(ctx, q).

type TraverseToken

type TraverseToken func(context.Context, *model.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 model.Querier) model.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 model.Query) error

Traverse calls f(ctx, q).

type TraverseVariable

type TraverseVariable func(context.Context, *model.VariableQuery) error

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

func (TraverseVariable) Intercept

func (f TraverseVariable) Intercept(next model.Querier) model.Querier

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

func (TraverseVariable) Traverse

func (f TraverseVariable) Traverse(ctx context.Context, q model.Query) error

Traverse calls f(ctx, q).

type VariableFunc

type VariableFunc func(context.Context, *model.VariableQuery) (model.Value, error)

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

func (VariableFunc) Query

func (f VariableFunc) Query(ctx context.Context, q model.Query) (model.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