proxy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Creator func(conf *ConfigVar) Proxy = NewHttp

Functions

func Handler

func Handler(ctx context.Context, request *fakehttp.Request, conf *ConfigVar)

Types

type Config

type Config struct {
	Url     string
	Headers []*Header
}

func DefaultConfig

func DefaultConfig() *Config

type ConfigVar

type ConfigVar struct {
	Url     *vari.Var
	Headers []*HeaderVar
}

func CompileConf

func CompileConf(conf *Config) *ConfigVar
type Header struct {
	Key   string
	Value string
}

type HeaderVar

type HeaderVar struct {
	Key   string
	Value *vari.Var
}

type Proxy

type Proxy interface {
	Do(ctx context.Context, request *fakehttp.Request) *fakehttp.Response
}

func NewHttp added in v0.1.2

func NewHttp(conf *ConfigVar) Proxy

Jump to

Keyboard shortcuts

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