apis

package
v0.0.0-...-e0ef9ee Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: BSD-2-Clause Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const DataLoadersKey = DataLoadersKeyType("DataLoadersKey")

Variables

This section is empty.

Functions

func CreateGatewayEngine

func CreateGatewayEngine(option Config) (*graphql.Engine, error)

func LoadOpenApiV2orV3Doc

func LoadOpenApiV2orV3Doc(docLocation EndpointOptions) (*openapi3.T, error)

func NewResolverFactory

func NewResolverFactory(doc *openapi3.T, options Config) (resolvers.Resolver, string, error)

Types

type CachedResolution

type CachedResolution struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Openapi      EndpointOptions `json:"spec,omitempty",yaml:"spec,omitempty"`
	APIBase      EndpointOptions `json:"api,omitempty",yaml:"api,omitempty"`
	QueryType    string
	MutationType string
	Log          *log.Logger
}

type Converter

type Converter func(value reflect.Value, err error) (reflect.Value, error)

type DataLoadersKeyType

type DataLoadersKeyType string

type EndpointOptions

type EndpointOptions struct {
	// URL is the endpoint or endpoint base path that will be accessed.
	URL string `yaml:"url,omitempty" json:"url,omitempty"`
	// BearerToken is the Authentication Bearer token that will added to the request headers.
	BearerToken string `yaml:"bearer-token,omitempty" json:"bearer-token,omitempty"`
	// Api key for the endpoint.
	ApiKey string `yaml:"api-key,omitempty" json:"api-key,omitempty"`
	// InsecureClient allows the client request to connect to TLS servers that do not have a valid certificate.
	InsecureClient bool         `yaml:"insecure-client,omitempty" json:"insecure-client,omitempty"`
	Client         *http.Client `yaml:"-" json:"-"`
	// OpenapiDocument is the content of the openapi document, if empty it will be loaded from the URL
	OpenapiDocument []byte `yaml:"-" json:"-"`
}

EndpointOptions defines how to access an endpoint URL

type HandlerTransport

type HandlerTransport struct {
	http.Handler
}

HandlerTransport is a http.RoundTripper implemented using an http.Handler bypassing the the need to go through the http/tcp stack when your http client wants to call a handler.

func (HandlerTransport) RoundTrip

func (h HandlerTransport) RoundTrip(request *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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