frontend

package
v0.0.0-...-97d4abd Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package frontend is responsible for handling connections to a postgres database.

Index

Constants

This section is empty.

Variables

View Source
var GlobalPreamble = []pgproto3.BackendMessage{}
View Source
var GlobalPreambleLock = &sync.RWMutex{}

Functions

func LaunchAll

func LaunchAll()

Types

type AttachChannels

type AttachChannels struct {
	Out     <-chan pgproto3.BackendMessage
	OutSync *misc.Cond
}

type FConn

type FConn struct {
	In chan<- pgproto3.FrontendMessage
	// contains filtered or unexported fields
}

func (*FConn) AttachBackend

func (c *FConn) AttachBackend(terminator func()) AttachChannels

func (*FConn) BackendTerminated

func (c *FConn) BackendTerminated()

func (*FConn) ClearApplicationName

func (c *FConn) ClearApplicationName()

func (*FConn) Closed

func (c *FConn) Closed() bool

func (*FConn) DetachBackend

func (c *FConn) DetachBackend()

func (*FConn) ReqPreamble

func (c *FConn) ReqPreamble()

func (*FConn) SetApplicationName

func (c *FConn) SetApplicationName(applicationName string)

type Pool

type Pool struct {
	Name string
	// contains filtered or unexported fields
}
var ReadPool *Pool
var WritePool *Pool

func NewPool

func NewPool(name string, size int, connMaxLifetime *time.Duration) *Pool

func (*Pool) Active

func (p *Pool) Active() int

func (*Pool) Expired

func (p *Pool) Expired()

Expired is called when a member of the pool will not be returning

func (*Pool) Len

func (p *Pool) Len() int

func (*Pool) Pop

func (p *Pool) Pop() *FConn

func (*Pool) Push

func (p *Pool) Push(v *FConn)

func (*Pool) PushNew

func (p *Pool) PushNew(v *FConn)

PushNew will push a connection onto the pool and increment active count

Directories

Path Synopsis
Package preambler contains an actor whose job is to send the Postgres preamble to each client on demand as clients connect to this particular Postgres frontend
Package preambler contains an actor whose job is to send the Postgres preamble to each client on demand as clients connect to this particular Postgres frontend
Package receiver contains an actor that receives messages from Postgres and (usually) forwards those messages to the backend manager.
Package receiver contains an actor that receives messages from Postgres and (usually) forwards those messages to the backend manager.
Package sender receives messages from the backend manager and forwards them directly to Postgres
Package sender receives messages from the backend manager and forwards them directly to Postgres

Jump to

Keyboard shortcuts

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