server

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryer

func NewQueryer(pm generator.Registry, caller Caller) graphql.Queryer

func Server

func Server(cfg *Config) (http.Handler, error)

Types

type Authentication

type Authentication struct {
	Tls *Tls `json:"tls" yaml:"tls"`
}

type Caller

type Caller interface {
	Call(ctx context.Context, rpc *desc.MethodDescriptor, message proto.Message) (proto.Message, error)
}

func NewReflectCaller

func NewReflectCaller(config *Grpc) (_ Caller, descs []*desc.FileDescriptor, err error)

type Config

type Config struct {
	Grpc       *Grpc         `json:"grpc" yaml:"grpc"`
	Cors       *cors.Options `json:"cors" yaml:"cors"`
	Playground *bool         `json:"playground" yaml:"playground"`
	Address    string        `json:"address" yaml:"address"`
	Tls        *Tls          `json:"tls" yaml:"tls"`
}

type Grpc

type Grpc struct {
	Services    []*Service
	ImportPaths []string
}

type QueryerLogger

type QueryerLogger struct {
	Next graphql.Queryer
}

func (QueryerLogger) Query

func (q QueryerLogger) Query(ctx context.Context, input *graphql.QueryInput, i interface{}) (err error)

type Service

type Service struct {
	Address        string          `json:"address" yaml:"address"`
	Authentication *Authentication `json:"authentication" yaml:"authentication"`
	Reflection     bool            `json:"reflection" yaml:"reflection"`
	ProtoFiles     []string        `json:"proto_files" yaml:"proto_files"`
}

type Tls

type Tls struct {
	Certificate string `json:"certificate" yaml:"certificate"`
	PrivateKey  string `json:"private_key" yaml:"private_key"`
}

Jump to

Keyboard shortcuts

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