middlewares

package
v0.0.0-...-214d0a7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ResponseWriter = "RESPONSE_WRITER"

Variables

This section is empty.

Functions

func WriterMiddleware

func WriterMiddleware() func(c *gin.Context)

WriterMiddleware 配置 Cookie 输出流到 ctx

Types

type BlueCardVaguer

type BlueCardVaguer struct{}

func (BlueCardVaguer) ExtensionName

func (BlueCardVaguer) ExtensionName() string

func (BlueCardVaguer) InterceptField

func (s BlueCardVaguer) InterceptField(ctx context.Context, next graphql.Resolver) (res interface{}, err error)

func (BlueCardVaguer) Validate

func (BlueCardVaguer) Validate(schema graphql.ExecutableSchema) error

type DirectiveDrivenAuthenticator

type DirectiveDrivenAuthenticator struct {
	SkipAuthFor []string
}

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware(skipAuthForDirectives ...string) DirectiveDrivenAuthenticator

NewAuthenticationMiddleware 自定义 Graphql HandlerExtension

func (DirectiveDrivenAuthenticator) ExtensionName

func (DirectiveDrivenAuthenticator) ExtensionName() string

func (DirectiveDrivenAuthenticator) InterceptField

func (d DirectiveDrivenAuthenticator) InterceptField(ctx context.Context, next graphql.Resolver) (interface{}, error)

InterceptField 检查是否需要校验 Cookie 以及校验后的值设置

func (DirectiveDrivenAuthenticator) Validate

type InjectableResponseWriter

type InjectableResponseWriter struct {
	gin.ResponseWriter
	Cookie *http.Cookie
}

InjectableResponseWriter 将 writer 载入到 ctx 中

func (*InjectableResponseWriter) Write

func (i *InjectableResponseWriter) Write(data []byte) (int, error)

type SubscriptionCacheClientLoader

type SubscriptionCacheClientLoader struct{}

func (SubscriptionCacheClientLoader) ExtensionName

func (SubscriptionCacheClientLoader) ExtensionName() string

func (SubscriptionCacheClientLoader) InterceptOperation

func (SubscriptionCacheClientLoader) Validate

Jump to

Keyboard shortcuts

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