Help us shape the future of Go! Take the 2026 Go Developer Survey

pgsql

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDriver

func GetDriver() *sql.Driver

GetDriver 函数用于获取 PgSQL 客户端的数据库驱动实例。 返回值为 *sql.Driver 类型,即数据库驱动指针。

Types

type DBPgsqlClient

type DBPgsqlClient struct {
	// 继承基础插件
	*plugins.BasePlugin
	// contains filtered or unexported fields
}

DBPgsqlClient 表示 PgSQL 客户端插件实例

func NewPgsqlClient

func NewPgsqlClient() *DBPgsqlClient

NewPgsqlClient 创建一个新的 PgSQL 客户端插件实例 返回一个指向 DBPgsqlClient 结构体的指针

func (*DBPgsqlClient) CheckHealth

func (p *DBPgsqlClient) CheckHealth() error

CheckHealth 对 HTTP 服务器进行健康检查。 该函数目前直接返回 nil,表示服务器健康,可根据实际需求添加检查逻辑。

func (*DBPgsqlClient) CleanupTasks

func (p *DBPgsqlClient) CleanupTasks() error

CleanupTasks 关闭数据库连接 返回错误信息,如果关闭连接失败则返回相应错误

func (*DBPgsqlClient) Configure

func (p *DBPgsqlClient) Configure(c any) error

Configure 更新 HTTP 服务器的配置。 该函数接收一个任意类型的参数,尝试将其转换为 *conf.Http 类型,如果转换成功则更新配置。

func (*DBPgsqlClient) InitializeResources

func (p *DBPgsqlClient) InitializeResources(rt plugins.Runtime) error

InitializeResources 从运行时配置中扫描并加载 PgSQL 配置 参数 rt 为运行时环境 返回错误信息,如果配置加载失败则返回相应错误

func (*DBPgsqlClient) StartupTasks

func (p *DBPgsqlClient) StartupTasks() error

StartupTasks 初始化数据库连接并进行健康检查 返回错误信息,如果连接或健康检查失败则返回相应错误

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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