middleware

package
v0.0.0-...-dff417c Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(chain ...HttpFilter) http.Handler

func InitHttpHandler

func InitHttpHandler(logger logging.Logger, resolvers GQLResolvers) http.Handler

Types

type Context

type Context = context.Context

type Filter

type Filter func(Service) Service

type GQLRequest

type GQLRequest struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

type GQLResolvers

type GQLResolvers struct {
	RootQueryResolver    resolver.GqlResolver
	RootMutationResolver resolver.GqlResolver
}

type GQLResponse

type GQLResponse struct {
	Data  interface{} `json:"data"`
	Error interface{} `json:"error"`
}

type HttpFilter

type HttpFilter func(next http.Handler) http.Handler

func AttachBatcher

func AttachBatcher(bm *batcher.BatcherManager) HttpFilter

type Service

type Service func(context.Context, interface{}) future.Future

func CreateGraphqlService

func CreateGraphqlService(
	logger logging.Logger,
	resolvers GQLResolvers,
) Service

CreateGraphqlService creates a Graphql Service with the injected logger and resolvers

Jump to

Keyboard shortcuts

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