Documentation ¶
Index ¶
- Constants
- func ErrorHTTPStatusHandler(next client.HTTPStatusHandler, name string) client.HTTPStatusHandler
- func GetHTTPStatusHandler(cfg *config.Backend) client.HTTPStatusHandler
- func LoadPlugins(folder, pattern string, logger logging.Logger)
- func NewBackendFactoryWithContext(ctx context.Context, logger logging.Logger, lcfg loggingConfig, ...) proxy.BackendFactory
- func NewEngine(cfg config.ServiceConfig, logger logging.Logger, lcfg loggingConfig, ...) *gin.Engine
- func NewExecutor(ctx context.Context) cmd.Executor
- func NewHandlerFactory(logger logging.Logger, lcfg loggingConfig, metricCollector *metrics.Metrics, ...) router.HandlerFactory
- func NewJoseHandlerFactory(hf ginkrakend.HandlerFactory, logger logging.Logger, ...) ginkrakend.HandlerFactory
- func NewOpenCensusClient(lcfg loggingConfig, clientFactory client.HTTPClientFactory) client.HTTPClientFactory
- func NewOpenCensusHandlerFactory(hf router.HandlerFactory, lcfg loggingConfig) router.HandlerFactory
- func NewProxyFactory(logger logging.Logger, backendFactory proxy.BackendFactory, ...) proxy.Factory
- func NewRouterLogger(cfg loggingConfig, w io.Writer) gin.HandlerFunc
- func NewSentryMiddleware(cfg config.ServiceConfig) gin.HandlerFunc
- func RegisterBloomd(scfg config.ServiceConfig, logger logging.Logger) (jose.Rejecter, error)
- func RegisterEncoders()
- func RegisterSubscriberFactories(ctx context.Context, cfg config.ServiceConfig, logger logging.Logger) func(n string, p int)
- type ResponseError
Constants ¶
const LoggerNamespace = "github_com/openrm/logging"
Variables ¶
This section is empty.
Functions ¶
func ErrorHTTPStatusHandler ¶
func ErrorHTTPStatusHandler(next client.HTTPStatusHandler, name string) client.HTTPStatusHandler
func GetHTTPStatusHandler ¶
func GetHTTPStatusHandler(cfg *config.Backend) client.HTTPStatusHandler
func LoadPlugins ¶
LoadPlugins loads and registers the plugins so they can be used if enabled at the configuration
func NewBackendFactoryWithContext ¶
func NewBackendFactoryWithContext(ctx context.Context, logger logging.Logger, lcfg loggingConfig, metricCollector *metrics.Metrics) proxy.BackendFactory
NewBackendFactory creates a BackendFactory by stacking all the available middlewares and injecting the received context
func NewEngine ¶
func NewEngine(cfg config.ServiceConfig, logger logging.Logger, lcfg loggingConfig, w io.Writer) *gin.Engine
NewEngine creates a new gin engine with some default values and a secure middleware
func NewExecutor ¶
NewExecutor returns an executor for the cmd package. The executor initalizes the entire gateway by registering the components and composing a RouterFactory wrapping all the middlewares.
func NewHandlerFactory ¶
func NewHandlerFactory(logger logging.Logger, lcfg loggingConfig, metricCollector *metrics.Metrics, rejecter jose.RejecterFactory) router.HandlerFactory
NewHandlerFactory returns a HandlerFactory with a rate-limit and a metrics collector middleware injected
func NewJoseHandlerFactory ¶
func NewJoseHandlerFactory(hf ginkrakend.HandlerFactory, logger logging.Logger, rf krakendjose.RejecterFactory) ginkrakend.HandlerFactory
func NewOpenCensusClient ¶
func NewOpenCensusClient(lcfg loggingConfig, clientFactory client.HTTPClientFactory) client.HTTPClientFactory
func NewOpenCensusHandlerFactory ¶
func NewOpenCensusHandlerFactory(hf router.HandlerFactory, lcfg loggingConfig) router.HandlerFactory
func NewProxyFactory ¶
func NewProxyFactory(logger logging.Logger, backendFactory proxy.BackendFactory, metricCollector *metrics.Metrics) proxy.Factory
NewProxyFactory returns a new ProxyFactory wrapping the injected BackendFactory with the default proxy stack and a metrics collector
func NewRouterLogger ¶
func NewRouterLogger(cfg loggingConfig, w io.Writer) gin.HandlerFunc
func NewSentryMiddleware ¶
func NewSentryMiddleware(cfg config.ServiceConfig) gin.HandlerFunc
func RegisterBloomd ¶
func RegisterBloomd(scfg config.ServiceConfig, logger logging.Logger) (jose.Rejecter, error)
func RegisterEncoders ¶
func RegisterEncoders()
RegisterEncoders registers all the available encoders
func RegisterSubscriberFactories ¶
func RegisterSubscriberFactories(ctx context.Context, cfg config.ServiceConfig, logger logging.Logger) func(n string, p int)
RegisterSubscriberFactories registers all the available sd adaptors
Types ¶
type ResponseError ¶
type ResponseError struct { Code int `json:"status"` Body interface{} `json:"body,omitempty"` // contains filtered or unexported fields }
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string
func (*ResponseError) Name ¶
func (r *ResponseError) Name() string
func (*ResponseError) StatusCode ¶
func (r *ResponseError) StatusCode() int
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package tests implements utility functions to help with API Gateway testing.
|
Package tests implements utility functions to help with API Gateway testing. |