Documentation ¶
Index ¶
Constants ¶
View Source
const ResponseWriter = "RESPONSE_WRITER"
Variables ¶
This section is empty.
Functions ¶
func WriterMiddleware ¶
WriterMiddleware 配置 Cookie 输出流到 ctx
Types ¶
type BlueCardVaguer ¶
type BlueCardVaguer struct{}
func (BlueCardVaguer) ExtensionName ¶
func (BlueCardVaguer) ExtensionName() string
func (BlueCardVaguer) InterceptField ¶
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 ¶
func (DirectiveDrivenAuthenticator) Validate(schema graphql.ExecutableSchema) error
type InjectableResponseWriter ¶
type InjectableResponseWriter struct { gin.ResponseWriter Cookie *http.Cookie }
InjectableResponseWriter 将 writer 载入到 ctx 中
type SubscriptionCacheClientLoader ¶
type SubscriptionCacheClientLoader struct{}
func (SubscriptionCacheClientLoader) ExtensionName ¶
func (SubscriptionCacheClientLoader) ExtensionName() string
func (SubscriptionCacheClientLoader) InterceptOperation ¶
func (s SubscriptionCacheClientLoader) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler
func (SubscriptionCacheClientLoader) Validate ¶
func (SubscriptionCacheClientLoader) Validate(schema graphql.ExecutableSchema) error
Click to show internal directories.
Click to hide internal directories.