gateway

package
v0.74.0-preview.11 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

README

API Gateways

This package provides GraphQL & REST gateways. These are connected in to the core via GRPC.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxSubscriptionReached = func(ip string, max uint32) error {
	return fmt.Errorf("max subscriptions count (%v) reached for ip (%s)", max, ip)
}

Functions

func Chain added in v0.56.0

func Chain(f http.Handler, m ...func(http.Handler) http.Handler) http.Handler

Chain builds the middleware Chain recursively, functions are first class.

func GenerateTlsConfig added in v0.67.1

func GenerateTlsConfig(g *Config, vegaPaths paths.Paths) (*tls.Config, http.Handler, error)

func MetricCollectionMiddleware

func MetricCollectionMiddleware(next http.Handler) http.Handler

MetricCollectionMiddleware records the request and the time taken to service it.

func RemoteAddrMiddleware

func RemoteAddrMiddleware(log *logging.Logger, next http.Handler) http.Handler

RemoteAddrMiddleware is a middleware adding to the current request context the address of the caller.

func WithAddHeadersMiddleware added in v0.56.0

func WithAddHeadersMiddleware(next http.Handler) http.Handler

Types

type Config

type Config struct {
	ServerConfig
	Level                    encoding.LogLevel        `` /* 148-byte string literal not displayed */
	Timeout                  encoding.Duration        `long:"timeout"`
	Node                     ServerConfig             `group:"Node"                                                                    namespace:"node"`
	GraphQL                  GraphqlServiceConfig     `group:"GraphQL"                                                                 namespace:"graphql"`
	REST                     RESTGatewayServiceConfig `group:"REST"                                                                    namespace:"rest"`
	SubscriptionRetries      int                      `description:" "                                                                 long:"subscription-retries"`
	GraphQLPlaygroundEnabled encoding.Bool            `description:"Enables the GraphQL playground"                                    long:"graphql-playground"`
	MaxSubscriptionPerClient