http_reverseproxy_handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheHandler

type CacheHandler struct {
	CacheURL     string              `json:"url"`
	CacheHeaders map[string][]string `json:"headers"`
	CacheData    []byte              `json:"data"`
}

type Handler

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

func NewHttpHandler

func NewHttpHandler(config *config.Config, handler *gin.Engine, cacheDriver service.CacheInterface) *Handler

NewHttpHandler initializes a new HTTP handler with the given configuration and cache driver.

func (*Handler) FetchData

func (h *Handler) FetchData(c *gin.Context)

FetchData fetches data from the remote server and caches the response.

func (*Handler) ReverseProxy

func (h *Handler) ReverseProxy(c *gin.Context)

ReverseProxy handles the reverse proxy logic, using cache if applicable.

func (*Handler) UseCache

func (h *Handler) UseCache(c *gin.Context)

UseCache retrieves cached data or fetches it if not found.

Jump to

Keyboard shortcuts

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