martian

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQ  string = "request"
	RESP        = "response"
)

Variables

View Source
var (
	ErrNoCert = errors.New("No certificate provided, tls proxy won't working")
)

Functions

This section is empty.

Types

type Modifiers

type Modifiers interface {
	martian.RequestModifier
}

type Proxy

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

func NewProxy

func NewProxy(address, tlsAddress, apiAddress string, opt ...ProxyOption) (*Proxy, error)

func (*Proxy) Close

func (p *Proxy) Close()

func (*Proxy) Run

func (p *Proxy) Run(ctx context.Context, enableApi bool) error

type ProxyOption

type ProxyOption = helper.OptionError[Proxy]

func WitDefaultWriter

func WitDefaultWriter(w io.Writer) ProxyOption

func WithEnpointConfiguration

func WithEnpointConfiguration(corsEnabled bool, transferToMQTTSettings bool) ProxyOption

func WithHarWriterLog

func WithHarWriterLog(writer io.Writer) ProxyOption

func WithHierarchicalModifierEnabled

func WithHierarchicalModifierEnabled(header string) ProxyOption

func WithLogInMem

func WithLogInMem(corsEnabled bool) ProxyOption

func WithLogLevel

func WithLogLevel(level int) ProxyOption

func WithMitm

func WithMitm(validity time.Duration, organization string, verify bool, x509c *x509.Certificate, privKey interface{}, cors bool) ProxyOption

func WithMitmCertsFile

func WithMitmCertsFile(validity time.Duration, name string, organization string, verify bool, cert string, key string, cors bool) ProxyOption

func WithMitmCertsGenerated

func WithMitmCertsGenerated(validity time.Duration, name string, organization string, verify bool, cors bool) ProxyOption

func WithModifiers

func WithModifiers(mod any) ProxyOption

func WithStdLog

func WithStdLog() ProxyOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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