gateway

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceDefinitionQuery = `` /* 150-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSourceObserver

type DataSourceObserver interface {
	UpdateDataSources(dataSourceConfig []graphqlDataSource.Configuration)
}

type DataSourceSubject

type DataSourceSubject interface {
	Register(observer DataSourceObserver)
}

type DatasourcePollerConfig

type DatasourcePollerConfig struct {
	Services        []ServiceConfig
	PollingInterval time.Duration
}

type DatasourcePollerPoller

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

func NewDatasource

func NewDatasource(serviceConfig []ServiceConfig, httpClient *http.Client) *DatasourcePollerPoller

func NewDatasourcePoller

func NewDatasourcePoller(
	httpClient *http.Client,
	config DatasourcePollerConfig,
) *DatasourcePollerPoller

func (*DatasourcePollerPoller) Register

func (d *DatasourcePollerPoller) Register(updateDatasourceObserver DataSourceObserver)

func (*DatasourcePollerPoller) Run

type GQLErr

type GQLErr []struct {
	Message string `json:"message"`
}

func (GQLErr) Error

func (g GQLErr) Error() string

type Gateway

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

func Handler

func Handler(
	logger log.Logger,
	datasourcePoller *DatasourcePollerPoller,
	httpClient *http.Client,
) *Gateway

func NewGateway

func NewGateway(
	gqlHandlerFactory HandlerFactory,
	httpClient *http.Client,
	logger log.Logger,
) *Gateway

func (*Gateway) Ready

func (g *Gateway) Ready()

func (*Gateway) ServeHTTP

func (g *Gateway) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Gateway) UpdateDataSources

func (g *Gateway) UpdateDataSources(newDataSourcesConfig []graphqlDataSource.Configuration)

Error handling is not finished.

type HandlerFactory

type HandlerFactory interface {
	Make(schema *graphql.Schema, engine *graphql.ExecutionEngineV2) http.Handler
}

type HandlerFactoryFn

type HandlerFactoryFn func(schema *graphql.Schema, engine *graphql.ExecutionEngineV2) http.Handler

func (HandlerFactoryFn) Make

type ServiceConfig

type ServiceConfig struct {
	Name string
	URL  string
	WS   string
}

Directories

Path Synopsis
Package http handles GraphQL HTTP Requests including WebSocket Upgrades.
Package http handles GraphQL HTTP Requests including WebSocket Upgrades.

Jump to

Keyboard shortcuts

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