mux

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ctx context.Context, database string, listenAddr string) error

Types

type Broadcast

type Broadcast[T any] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBroadcast

func NewBroadcast[T any]() *Broadcast[T]

func (*Broadcast[T]) Close

func (b *Broadcast[T]) Close()

func (*Broadcast[T]) Send

func (b *Broadcast[T]) Send(msg T)

func (*Broadcast[T]) Subscribe

func (b *Broadcast[T]) Subscribe() <-chan T

func (*Broadcast[T]) Unsubscribe

func (b *Broadcast[T]) Unsubscribe(ch <-chan T)

type Mux

type Mux struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Mux) HandleConn

func (m *Mux) HandleConn(ctx context.Context, clientNetConn net.Conn) error

type MuxClientConn

type MuxClientConn struct {
	net.Conn
	*pgproto3.Backend
	// contains filtered or unexported fields
}

func NewMuxClientConn

func NewMuxClientConn(conn net.Conn) *MuxClientConn

type MuxCommand

type MuxCommand struct {
	Database   string `cli:"required,short=d,env=PGT_DATABASE,help=database connection string"`
	ListenAddr string `cli:"required,short=l"`
}

func NewMuxCommand

func NewMuxCommand() *MuxCommand

func (*MuxCommand) Run

func (cmd *MuxCommand) Run(ctx context.Context) error

func (*MuxCommand) SetupCommand

func (*MuxCommand) SetupCommand(cmd *cli.Command)

type MuxServerConn

type MuxServerConn struct {
	sync.Mutex
	*pgconn.HijackedConn
	*pgproto3.Frontend
	// contains filtered or unexported fields
}

func NewMuxServerConn

func NewMuxServerConn(conn *pgconn.HijackedConn) *MuxServerConn

Jump to

Keyboard shortcuts

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