proxy

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewH2cRoundTripper

func NewH2cRoundTripper(log log.Logger, hook hook.Service) http.RoundTripper

func Serve

func Serve(
	ctx context.Context,
	logger log.Logger,
	cfg Config,
	handler http.Handler,
) func(ctx context.Context) error

func WithoutCancel added in v0.4.0

func WithoutCancel(ctx context.Context) context.Context

Types

type Config

type Config struct {
	// port to listen on
	Port int `yaml:"port" mapstructure:"port" default:"8080"`
	// the network interface to listen on
	Host string `yaml:"host" mapstructure:"host" default:"127.0.0.1"`

	Name string

	// RulesPath is a directory path where ruleset is defined
	// that this service should implement
	RulesPath string `yaml:"ruleset" mapstructure:"ruleset"`
	// RulesPathSecret could be a env name, file path or actual value required
	// to access RulesPath files
	RulesPathSecret string `yaml:"ruleset_secret" mapstructure:"ruleset_secret"`
}

type Context added in v0.4.0

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

func (Context) Deadline added in v0.4.0

func (c Context) Deadline() (time.Time, bool)

func (Context) Done added in v0.4.0

func (c Context) Done() <-chan struct{}

func (Context) Err added in v0.4.0

func (c Context) Err() error

func (Context) Value added in v0.4.0

func (c Context) Value(key interface{}) interface{}

type Director

type Director struct {
}

func NewDirector

func NewDirector() *Director

func (Director) Direct

func (h Director) Direct(req *http.Request)

type H2c

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

H2c

func NewH2c

func NewH2c(roundTripper http.RoundTripper, director RequestDirector) *H2c

func (*H2c) ServeHTTP

func (p *H2c) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RequestDirector

type RequestDirector interface {
	// Build prepares a request that will be sent to backend service
	Direct(*http.Request)
}

type ServicesConfig

type ServicesConfig struct {
	Services []Config `yaml:"services" mapstructure:"services"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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