decorators

package
v0.0.0-...-cae665e Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextAuthApply

func ContextAuthApply() func(context.Context) context.Context

ContextUserApply consume the user from graphql context

func ContextAuthConsumer

func ContextAuthConsumer(handler func(graphql.ResolveParams, interface{}) (interface{}, error)) func(graphql.ResolveParams) (interface{}, error)

ContextUserScopesValidator consume the user from graphql context

/ scopes []string,

func ContextAuthIsAdmin

func ContextAuthIsAdmin(handler func(graphql.ResolveParams) (interface{}, error)) func(graphql.ResolveParams) (interface{}, error)

func ContextPubSubApply

func ContextPubSubApply(value interface{}) func(context.Context) context.Context

ContextRepoApply apply the model to graphql context

func ContextPubSubConsumer

func ContextPubSubConsumer(handler func(interface{}) (interface{}, error)) func(graphql.ResolveParams) (interface{}, error)

ContextRepoConsumer consume the model from graphql context

func ContextRepoApply

func ContextRepoApply(model mongodb.Repo) func(context.Context) context.Context

ContextRepoApply apply the model to graphql context

func ContextRepoConsumer

func ContextRepoConsumer(handler func(graphql.ResolveParams, mongodb.Repo) (interface{}, error)) func(graphql.ResolveParams) (interface{}, error)

ContextRepoConsumer consume the model from graphql context

func ContextUserApply

func ContextUserApply(user User) func(context.Context) context.Context

ContextUserApply consume the user from graphql context

func ContextUserScopesValidator

func ContextUserScopesValidator(scopes []string, handler func(graphql.ResolveParams) (interface{}, error)) func(graphql.ResolveParams) (interface{}, error)

ContextUserScopesValidator consume the user from graphql context

func ValidateJWT

func ValidateJWT(t string, secret string) (interface{}, error)

Types

type User

type User struct {
	Name   string
	Scopes []string
}

Jump to

Keyboard shortcuts

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