pg

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package pg provides PostgreSQL handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts *NewOpts) (handlers.Interface, error)

New returns a new handler.

Types

type Handler

type Handler struct {
	*NewOpts
	// contains filtered or unexported fields
}

Handler implements handlers.Interface on PostgreSQL.

func (*Handler) Close added in v0.2.1

func (h *Handler) Close()

Close implements HandlerInterface.

func (*Handler) CmdQuery added in v0.2.0

func (h *Handler) CmdQuery(ctx context.Context, query *wire.OpQuery) (*wire.OpReply, error)

CmdQuery implements HandlerInterface.

func (*Handler) Collect added in v1.5.0

func (h *Handler) Collect(ch chan<- prometheus.Metric)

Collect implements handlers.Interface.

func (*Handler) DBPool added in v0.8.0

func (h *Handler) DBPool(ctx context.Context) (*pgdb.Pool, error)

DBPool returns database connection pool for the given client connection.

Pool is not closed when ctx is canceled.

func (*Handler) Describe added in v1.5.0

func (h *Handler) Describe(ch chan<- *prometheus.Desc)

Describe implements handlers.Interface.

func (*Handler) MsgAggregate added in v0.5.2

func (h *Handler) MsgAggregate(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgAggregate implements HandlerInterface.

func (*Handler) MsgBuildInfo

func (h *Handler) MsgBuildInfo(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgBuildInfo implements HandlerInterface.

func (*Handler) MsgCollMod added in v0.5.3

func (h *Handler) MsgCollMod(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCollMod implements HandlerInterface.

func (*Handler) MsgCollStats

func (h *Handler) MsgCollStats(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCollStats implements HandlerInterface.

func (*Handler) MsgConnectionStatus added in v0.2.1

func (h *Handler) MsgConnectionStatus(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgConnectionStatus implements HandlerInterface.

func (*Handler) MsgCount

func (h *Handler) MsgCount(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCount implements HandlerInterface.

func (*Handler) MsgCreate

func (h *Handler) MsgCreate(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCreate implements HandlerInterface.

func (*Handler) MsgCreateIndexes

func (h *Handler) MsgCreateIndexes(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCreateIndexes implements HandlerInterface.

func (*Handler) MsgCurrentOp added in v0.8.0

func (h *Handler) MsgCurrentOp(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgCurrentOp implements HandlerInterface.

func (*Handler) MsgDBStats

func (h *Handler) MsgDBStats(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDBStats implements HandlerInterface.

func (*Handler) MsgDataSize

func (h *Handler) MsgDataSize(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDataSize implements HandlerInterface.

func (*Handler) MsgDebugError added in v0.2.0

func (h *Handler) MsgDebugError(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDebugError implements HandlerInterface.

func (*Handler) MsgDelete

func (h *Handler) MsgDelete(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDelete implements HandlerInterface.

func (*Handler) MsgDistinct added in v0.8.1

func (h *Handler) MsgDistinct(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDistinct implements HandlerInterface.

func (*Handler) MsgDrop

func (h *Handler) MsgDrop(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDrop implements HandlerInterface.

func (*Handler) MsgDropDatabase

func (h *Handler) MsgDropDatabase(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDropDatabase implements HandlerInterface.

func (*Handler) MsgDropIndexes added in v1.0.0

func (h *Handler) MsgDropIndexes(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgDropIndexes implements HandlerInterface.

func (*Handler) MsgExplain added in v0.5.1

func (h *Handler) MsgExplain(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgExplain implements HandlerInterface.

func (*Handler) MsgFind

func (h *Handler) MsgFind(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgFind implements HandlerInterface.

func (*Handler) MsgFindAndModify added in v0.2.0

func (h *Handler) MsgFindAndModify(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgFindAndModify implements HandlerInterface.

func (*Handler) MsgGetCmdLineOpts

func (h *Handler) MsgGetCmdLineOpts(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgGetCmdLineOpts implements HandlerInterface.

func (*Handler) MsgGetFreeMonitoringStatus added in v0.4.0

func (h *Handler) MsgGetFreeMonitoringStatus(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgGetFreeMonitoringStatus implements HandlerInterface.

func (*Handler) MsgGetLog

func (h *Handler) MsgGetLog(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgGetLog implements HandlerInterface.

func (*Handler) MsgGetMore added in v0.9.2

func (h *Handler) MsgGetMore(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgGetMore implements handlers.Interface.

func (*Handler) MsgGetParameter

func (h *Handler) MsgGetParameter(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgGetParameter implements HandlerInterface.

func (*Handler) MsgHello

func (h *Handler) MsgHello(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgHello implements HandlerInterface.

func (*Handler) MsgHostInfo

func (h *Handler) MsgHostInfo(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgHostInfo implements HandlerInterface.

func (*Handler) MsgInsert

func (h *Handler) MsgInsert(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgInsert implements HandlerInterface.

func (*Handler) MsgIsMaster

func (h *Handler) MsgIsMaster(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgIsMaster implements HandlerInterface.

func (*Handler) MsgKillCursors added in v1.6.0

func (h *Handler) MsgKillCursors(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgKillCursors implements handlers.Interface.

func (*Handler) MsgListCollections

func (h *Handler) MsgListCollections(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgListCollections implements HandlerInterface.

func (*Handler) MsgListCommands added in v0.2.0

func (h *Handler) MsgListCommands(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgListCommands implements handlers.Interface.

func (*Handler) MsgListDatabases

func (h *Handler) MsgListDatabases(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgListDatabases implements HandlerInterface.

func (*Handler) MsgListIndexes added in v0.7.0

func (h *Handler) MsgListIndexes(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgListIndexes implements HandlerInterface.

func (*Handler) MsgLogout added in v1.3.0

func (h *Handler) MsgLogout(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgLogout implements HandlerInterface.

func (*Handler) MsgPing

func (h *Handler) MsgPing(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgPing implements HandlerInterface.

func (*Handler) MsgRenameCollection added in v1.1.0

func (h *Handler) MsgRenameCollection(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgRenameCollection implements HandlerInterface.

func (*Handler) MsgSASLStart added in v0.8.0

func (h *Handler) MsgSASLStart(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgSASLStart implements HandlerInterface.

func (*Handler) MsgServerStatus

func (h *Handler) MsgServerStatus(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgServerStatus implements HandlerInterface.

func (*Handler) MsgSetFreeMonitoring added in v0.4.0

func (h *Handler) MsgSetFreeMonitoring(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgSetFreeMonitoring implements HandlerInterface.

func (*Handler) MsgUpdate

func (h *Handler) MsgUpdate(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgUpdate implements HandlerInterface.

func (*Handler) MsgValidate added in v0.7.1

func (h *Handler) MsgValidate(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgValidate implements HandlerInterface.

func (*Handler) MsgWhatsMyURI

func (h *Handler) MsgWhatsMyURI(ctx context.Context, msg *wire.OpMsg) (*wire.OpMsg, error)

MsgWhatsMyURI implements HandlerInterface.

type NewOpts

type NewOpts struct {
	PostgreSQLURL string

	L             *zap.Logger
	ConnMetrics   *connmetrics.ConnMetrics
	StateProvider *state.Provider

	// test options
	DisableFilterPushdown bool
	EnableSortPushdown    bool
}

NewOpts represents handler configuration.

Directories

Path Synopsis
Package pgdb provides PostgreSQL connection utilities.
Package pgdb provides PostgreSQL connection utilities.

Jump to

Keyboard shortcuts

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