handler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchResult

type DispatchResult struct {
	Code     int
	Duration float64
	Body     []byte
	Tenant   string
	Error    error
}

Result after dispatching a request from a processor to the backend.

type Handler

type Handler struct {
	Config  config.Config
	Srv     *fh.Server
	Cli     *fh.Client
	Log     logr.Logger
	Store   *stores.NamespaceStore
	Metrics *metrics.ProxyRecorder
	Auth    struct {
		EgressHeader []byte
	}
	Closing uint32
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	log logr.Logger,
	c config.Config,
	store *stores.NamespaceStore,
	metrics *metrics.ProxyRecorder,
	name string,
	processFunc func(*Handler, *fh.Request) (map[string][]byte, error),
	headerFunc func(clientIP net.Addr, reqID uuid.UUID, tenant string, req *fh.Request),
) *Handler

Initialize a new Processor.

func (*Handler) Health

func (p *Handler) Health() error

func (*Handler) Start

func (p *Handler) Start(ctx context.Context) error

Start implements the Runnable interface. It should block until the context is done (i.e. shutdown is triggered).

Jump to

Keyboard shortcuts

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