gqlopencensus

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Example
package main

import (
	"log"
	"net/http"

	"gitee.com/shiqiyue/gqlgen-contrib/gqlopencensus"
	"github.com/99designs/gqlgen/graphql"
	"github.com/99designs/gqlgen/graphql/handler"
)

var es graphql.ExecutableSchema

func main() {
	// NOTE: requires setting of Exporter
	//   trace.RegisterExporter(exporter)

	srv := handler.NewDefaultServer(es)
	srv.Use(gqlopencensus.Tracer{})

	http.Handle("/query", srv)

	if err := http.ListenAndServe(":8080", nil); err != nil {
		log.Fatal(err)
	}
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracer

type Tracer struct {
	ComplexityExtensionName string
	DataDog                 bool
}

func (Tracer) ExtensionName

func (a Tracer) ExtensionName() string

func (Tracer) InterceptField

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

func (Tracer) InterceptOperation

func (a Tracer) InterceptOperation(ctx context.Context, next graphql.OperationHandler) graphql.ResponseHandler

func (Tracer) Validate

func (a Tracer) Validate(schema graphql.ExecutableSchema) error

Jump to

Keyboard shortcuts

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