app

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package app contains the HTTP layer for the mock server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(version, mockPath string, cfg *config.Config, mck *config.Mock) http.Handler

RegisterHandlers registers all handlers of the application.

Types

type CORS added in v0.5.0

type CORS struct {
	IsAllowed func(string) bool
	// contains filtered or unexported fields
}

CORS provides cross-origin resource sharing middleware.

func NewCORS added in v0.5.0

func NewCORS(allowedOrigins ...string) *CORS

NewCORS creates new CORS.

func (*CORS) Middleware added in v0.5.0

func (c *CORS) Middleware(next http.Handler) http.Handler

Middleware returns the CORS middleware handler.

type Proxy added in v0.6.0

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy wraps a reverse proxy with URL rewriting.

func (*Proxy) ServeHTTP added in v0.6.0

func (p *Proxy) ServeHTTP(writer http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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