Documentation ¶
Index ¶
- Variables
- func Chain(f http.Handler, m ...func(http.Handler) http.Handler) http.Handler
- func GenerateTlsConfig(g *Config, furyPaths paths.Paths) (*tls.Config, http.Handler, error)
- func MetricCollectionMiddleware(next http.Handler) http.Handler
- func RemoteAddrMiddleware(log *logging.Logger, next http.Handler) http.Handler
- func WithAddHeadersMiddleware(next http.Handler) http.Handler
- type Config
- type GraphqlServiceConfig
- type InjectableResponseWriter
- type RESTGatewayServiceConfig
- type ServerConfig
- type SubscriptionRateLimiter
- func (s *SubscriptionRateLimiter) Dec(ip string)
- func (s *SubscriptionRateLimiter) Inc(ip string) error
- func (s *SubscriptionRateLimiter) WithGrpcInterceptor(ipGetterFunc ipGetter) grpc.StreamServerInterceptor
- func (s *SubscriptionRateLimiter) WithSubscriptionRateLimiter(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GenerateTlsConfig ¶
func MetricCollectionMiddleware ¶
MetricCollectionMiddleware records the request and the time taken to service it.
func RemoteAddrMiddleware ¶
RemoteAddrMiddleware is a middleware adding to the current request context the address of the caller.
Types ¶
type Config ¶
type Config struct { ServerConfig Level encoding.LogLevel `long:"log-level" choice:"debug" choice:"info" choice:"warning"` 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 `long:"subscription-retries" description:" "` GraphQLPlaygroundEnabled encoding.Bool `long:"graphql-playground" description:"Enables the GraphQL playground"` MaxSubscriptionPerClient uint32 `long:"max-subscription-per-client" description:"Maximum graphql subscriptions allowed per client"` CORS libhttp.CORSConfig `group:"CORS" namespace:"cors"` HTTPSEnabled encoding.Bool `long:"https-enabled" description:"If true, GraphQL gateway will require an HTTPS connection"` AutoCertDomain string `long:"auto-cert-domain" description:"Automatically generate and sign https certificate via LetsEncrypt"` CertificateFile string `long:"certificate-file" description:"Path to SSL certificate, if using HTTPS but not autocert"` KeyFile string `long:"key-file" description:"Path to private key, if using HTTPS but not autocert"` RateLimit ratelimit.Config `group:"RateLimits" namespace:"rate-limits"` }
Config represents the general configuration for the gateway.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.
type GraphqlServiceConfig ¶
type GraphqlServiceConfig struct { Enabled encoding.Bool `long:"enabled" description:"Start the GraphQl gateway"` ComplexityLimit int `long:"complexity-limit"` Endpoint string `long:"endpoint" description:"Endpoint to expose the graphql API at"` }
GraphqlServiceConfig represents the configuration of the gateway.
type InjectableResponseWriter ¶
type InjectableResponseWriter struct { http.ResponseWriter http.Hijacker // contains filtered or unexported fields }
func InjectableWriterFromContext ¶
func InjectableWriterFromContext(ctx context.Context) (*InjectableResponseWriter, bool)
func (*InjectableResponseWriter) SetHeaders ¶
func (i *InjectableResponseWriter) SetHeaders(headers http.Header)
type RESTGatewayServiceConfig ¶
type RESTGatewayServiceConfig struct { Enabled encoding.Bool `long:"enabled" choice:"true" choice:"false" description:"Start the REST gateway"` APMEnabled encoding.Bool `long:"apm-enabled" choice:"true" choice:"false" description:" "` }
RESTGatewayServiceConfig represent the configuration of the rest service.
type ServerConfig ¶
type ServerConfig struct { Port int `long:"port" description:"Listen for connection on port <port>"` IP string `long:"ip" description:"Bind to address <ip>"` }
ServerConfig represent the configuration of a server in fury.
type SubscriptionRateLimiter ¶
type SubscriptionRateLimiter struct { MaxSubscriptions uint32 // contains filtered or unexported fields }
func NewSubscriptionRateLimiter ¶
func NewSubscriptionRateLimiter( log *logging.Logger, maxSubscriptions uint32, ) *SubscriptionRateLimiter
func (*SubscriptionRateLimiter) Dec ¶
func (s *SubscriptionRateLimiter) Dec(ip string)
func (*SubscriptionRateLimiter) Inc ¶
func (s *SubscriptionRateLimiter) Inc(ip string) error
func (*SubscriptionRateLimiter) WithGrpcInterceptor ¶
func (s *SubscriptionRateLimiter) WithGrpcInterceptor(ipGetterFunc ipGetter) grpc.StreamServerInterceptor
func (*SubscriptionRateLimiter) WithSubscriptionRateLimiter ¶
func (s *SubscriptionRateLimiter) WithSubscriptionRateLimiter(next http.Handler) http.Handler
Directories ¶
Path | Synopsis |
---|---|
Package gql contains code for running the GraphQL-to-gRPC gateway.
|
Package gql contains code for running the GraphQL-to-gRPC gateway. |
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Package rest contains code for running the REST-to-gRPC gateway.
|
Package rest contains code for running the REST-to-gRPC gateway. |
Click to show internal directories.
Click to hide internal directories.