proxy

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const AnyHTTPMethod = "<ANY>"

Variables

This section is empty.

Functions

func TransparentHandler

func TransparentHandler(requestURIFn func(c *routing.Context) string, client *Client) func(c *routing.Context) error

func TransparentOverCacheHandler

func TransparentOverCacheHandler(requestURIFn RequestURIFn, client *Client, store *store.TTLCache) func(c *routing.Context) error

Types

type Client

type Client struct {
	fasthttp.Client
}

func (*Client) Do

func (c *Client) Do(req *fasthttp.Request, resp *fasthttp.Response) error

type Config

type Config struct {
	Port             string `help:"listen port"`
	Bindaddr         string `help:"bindable address"`
	ConcurrencyLimit int    `help:"server concurrency limit"`
}

func (Config) Validate

func (c Config) Validate() error

type RequestURIFn

type RequestURIFn func(c *routing.Context) string

type Routable

type Routable interface {
	Routes() []struct {
		Path    string
		Method  string
		Handler func(c *routing.Context) error
	}

	Name() string
}

type Server added in v1.2.1

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

func New

func New(config *Config, routable Routable) *Server

func (*Server) Serve added in v1.2.1

func (s *Server) Serve()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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