httpingress

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package httpingress implements the http.ingress.core microservice.

The HTTP ingress microservice relays incoming HTTP requests to the NATS bus.

Index

Constants

View Source
const Hostname = "http.ingress.core"

Hostname is the default hostname of the microservice: http.ingress.core.

View Source
const SourceCodeSHA256 = "4bed259286710e280f9d8e5337ad797f13f786148759d502f951e9a657fd0d9c"
View Source
const Timestamp = "2024-08-01T15:49:24.691176Z"
View Source
const Version = 253

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware interface {
	Serve(w http.ResponseWriter, r *http.Request, next connector.HTTPHandler) (err error)
}

Middleware is a processor that can be added to pre- or post-process a request. It should call the next function in the chain.

type MiddlewareFunc

type MiddlewareFunc func(w http.ResponseWriter, r *http.Request, next connector.HTTPHandler) (err error)

MiddlewareFunc is a processor that can be added to pre- or post-process a request. It should call the next function in the chain.

type Mock

type Mock = intermediate.Mock

Mock is a mockable version of the http.ingress.core microservice, allowing functions, event sinks and web handlers to be mocked.

func NewMock

func NewMock() *Mock

New creates a new mockable version of the microservice.

type Service

type Service struct {
	*intermediate.Intermediate // DO NOT REMOVE
	// contains filtered or unexported fields
}

Service implements the http.ingress.core microservice.

The HTTP ingress microservice relays incoming HTTP requests to the NATS bus.

func NewService

func NewService() *Service

NewService creates a new http.ingress.core microservice.

func (*Service) AddMiddleware

func (svc *Service) AddMiddleware(middleware ...Middleware) error

AddMiddleware adds a Middleware to the chain of middleware. Middleware is a processor that can be added to pre- or post-process a request. Middlewares are chained together. Each receives the request after it was processed by the preceding (upstream) middleware, passing it along to the next (downstream) one. And conversely, each receives the response from the next (downstream) middleware, and passes it back to the preceding (upstream) middleware. The request and/or response may be modified in the process. A middleware should call the next function in the chain.

func (*Service) AddMiddlewareFunc

func (svc *Service) AddMiddlewareFunc(handler ...MiddlewareFunc) error

AddMiddleware creates a middleware for each MiddlewareFunc and adds them to the chain of middleware.

func (*Service) Init

func (svc *Service) Init(initializer func(svc *Service)) *Service

Init enables a single-statement pattern for initializing the microservice.

svc.Init(func(svc Service) {
	svc.SetGreeting("Hello")
})

func (*Service) OnChangedAllowedOrigins

func (svc *Service) OnChangedAllowedOrigins(ctx context.Context) (err error)

OnChangedAllowedOrigins is triggered when the value of the AllowedOrigins config property changes.

func (*Service) OnChangedBlockedPaths

func (svc *Service) OnChangedBlockedPaths(ctx context.Context) (err error)

OnChangedBlockedPaths is triggered when the value of the BlockPaths config property changes.

func (*Service) OnChangedPortMappings

func (svc *Service) OnChangedPortMappings(ctx context.Context) (err error)

OnChangedPortMappings is triggered when the value of the PortMappings config property changes.

func (*Service) OnChangedPorts

func (svc *Service) OnChangedPorts(ctx context.Context) (err error)

OnChangedPorts is triggered when the value of the Ports config property changes.

func (*Service) OnChangedReadHeaderTimeout

func (svc *Service) OnChangedReadHeaderTimeout(ctx context.Context) (err error)

OnChangedReadHeaderTimeout is triggered when the value of the ReadHeaderTimeout config property changes.

func (*Service) OnChangedReadTimeout

func (svc *Service) OnChangedReadTimeout(ctx context.Context) (err error)

OnChangedReadTimeout is triggered when the value of the ReadTimeout config property changes.

func (*Service) OnChangedServerLanguages

func (svc *Service) OnChangedServerLanguages(ctx context.Context) (err error)

OnChangedServerLanguages is triggered when the value of the ServerLanguages config property changes.

func (*Service) OnChangedWriteTimeout

func (svc *Service) OnChangedWriteTimeout(ctx context.Context) (err error)

OnChangedWriteTimeout is triggered when the value of the WriteTimeout config property changes.

func (*Service) OnShutdown

func (svc *Service) OnShutdown(ctx context.Context) (err error)

OnShutdown is called when the microservice is shut down.

func (*Service) OnStartup

func (svc *Service) OnStartup(ctx context.Context) (err error)

OnStartup is called when the microservice is started up.

func (*Service) ServeHTTP

func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP forwards incoming HTTP requests to the appropriate microservice on NATS. An incoming request http://localhost:8080/echo.example/echo is forwarded to the microservice at https://echo.example/echo . ServeHTTP implements the http.Handler interface

Directories

Path Synopsis
app
Package httpingressapi implements the public API of the http.ingress.core microservice, including clients and data structures.
Package httpingressapi implements the public API of the http.ingress.core microservice, including clients and data structures.
Package intermediate serves as the foundation of the http.ingress.core microservice.
Package intermediate serves as the foundation of the http.ingress.core microservice.

Jump to

Keyboard shortcuts

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