proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: Apache-2.0 Imports: 13 Imported by: 1

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