intercept

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByProject

func ByProject(idColumn string) ent.Interceptor

ByProject returns an ent.Interceptor to intercept a SQL query statement, it works with WithProjectInterceptor. ByProject means the query resources must own by the projects of the contextual subject.

func ByProjectOptional

func ByProjectOptional(idColumn string) ent.Interceptor

ByProjectOptional returns an ent.Interceptor to intercept a SQL query statement, it works with WithProjectInterceptor. ByProjectOptional means the query resources should own by the projects of the contextual subject, or global.

func BySubject

func BySubject(idColumn string) ent.Interceptor

BySubject returns an ent.Interceptor to intercept a SQL query statement, it works with WithSubjectInterceptor.

func WithProjectInterceptor

func WithProjectInterceptor(ctx context.Context) context.Context

WithProjectInterceptor values the given context to indicate DAO that must embed the owned projects of the contextual subject into the WHERE clause of the SQL query statement. WithProjectInterceptor only works with those schemas using the ent.Interceptor created by ByProject.

func WithSubjectInterceptor

func WithSubjectInterceptor(ctx context.Context) context.Context

WithSubjectInterceptor values the given context to indicate DAO that must embed the contextual subject ID into the WHERE clause of the SQL query statement. WithSubjectInterceptor only works with those schemas using the ent.Interceptor created by BySubject.

Types

This section is empty.

Jump to

Keyboard shortcuts

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