handler

package
v0.0.0-...-03485e9 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

Proxy contains handler func for proxying HTTP requests.

func NewProxy

func NewProxy(service ProxyService) *Proxy

NewProxy is a constructor for Proxy.

func (Proxy) Redirect

func (p Proxy) Redirect(w http.ResponseWriter, r *http.Request)

Redirect example @Summary Redirect an HTTP request to third-party service @ID redirect @Accept json @Produce json @Success 200 {object} model.RedirectResponse "OK" @Failure 400 {object} status.ErrorResponse "Validation error" @Failure 500 {object} status.ErrorResponse "Internal error" @Router /api/v1/redirect [post] Redirect validates request body of the request, proxies the request and returns a response.

type ProxyService

type ProxyService interface {
	Redirect(ctx context.Context, request model.RedirectRequest) (model.RedirectResponse, error)
}

Jump to

Keyboard shortcuts

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