proxy

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxTcpPayload = 65535

Variables

View Source
var (
	MissingRequiredTargetFields = errors.New("required target fields missing in target props")
	BackendAuthenticationError  = errors.New("backend authentication failed")
	BackendInvalidMessage       = errors.New("unexpected message received from backend")
)

Functions

func Start

func Start()

Start PostgreSQL authentication proxy server

Types

type AuthMapper

type AuthMapper = func(props map[string]string, password string, salt [4]byte) (map[string]string, error)

type ProxyBack

type ProxyBack struct {
	TargetProps map[string]string
	TargetHost  string
	// contains filtered or unexported fields
}

func NewProxyBackend

func NewProxyBackend(targetProps map[string]string, originProps map[string]string) (*ProxyBack, error)

func (*ProxyBack) Close

func (b *ProxyBack) Close()

func (*ProxyBack) Run

func (b *ProxyBack) Run(frontConn net.Conn, frontChunkReader pgproto3.ChunkReader) error

type ProxyFront

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

func NewProxyFront

func NewProxyFront(conn net.Conn, authMapper AuthMapper) *ProxyFront

func (ProxyFront) Close

func (f ProxyFront) Close()

func (*ProxyFront) Run

func (f *ProxyFront) Run()

Jump to

Keyboard shortcuts

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