postgresql

package
v3.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(t *gotext.Locale, setting biz.SettingRepo, databaseServer biz.DatabaseServerRepo) *App

func (*App) ClearLog

func (s *App) ClearLog(w http.ResponseWriter, r *http.Request)

ClearLog 清空日志

func (*App) GetConfig

func (s *App) GetConfig(w http.ResponseWriter, r *http.Request)

GetConfig 获取配置

func (*App) GetConfigTune

func (s *App) GetConfigTune(w http.ResponseWriter, r *http.Request)

GetConfigTune 获取 PostgreSQL 配置调整参数

func (*App) GetPostgresPassword

func (s *App) GetPostgresPassword(w http.ResponseWriter, r *http.Request)

GetPostgresPassword 获取 postgres 用户密码

func (*App) GetUserConfig

func (s *App) GetUserConfig(w http.ResponseWriter, r *http.Request)

GetUserConfig 获取用户配置

func (*App) Load

func (s *App) Load(w http.ResponseWriter, r *http.Request)

Load 获取负载

func (*App) Log

func (s *App) Log(w http.ResponseWriter, r *http.Request)

Log 获取日志

func (*App) Route

func (s *App) Route(r chi.Router)

func (*App) SetPostgresPassword

func (s *App) SetPostgresPassword(w http.ResponseWriter, r *http.Request)

SetPostgresPassword 设置 postgres 用户密码

func (*App) UpdateConfig

func (s *App) UpdateConfig(w http.ResponseWriter, r *http.Request)

UpdateConfig 保存配置

func (*App) UpdateConfigTune

func (s *App) UpdateConfigTune(w http.ResponseWriter, r *http.Request)

UpdateConfigTune 更新 PostgreSQL 配置调整参数

func (*App) UpdateUserConfig

func (s *App) UpdateUserConfig(w http.ResponseWriter, r *http.Request)

UpdateUserConfig 保存用户配置

type ConfigTune

type ConfigTune struct {
	// 连接设置
	ListenAddresses              string `form:"listen_addresses" json:"listen_addresses"`
	Port                         string `form:"port" json:"port"`
	MaxConnections               string `form:"max_connections" json:"max_connections"`
	SuperuserReservedConnections string `form:"superuser_reserved_connections" json:"superuser_reserved_connections"`
	// 内存设置
	SharedBuffers      string `form:"shared_buffers" json:"shared_buffers"`
	WorkMem            string `form:"work_mem" json:"work_mem"`
	MaintenanceWorkMem string `form:"maintenance_work_mem" json:"maintenance_work_mem"`
	EffectiveCacheSize string `form:"effective_cache_size" json:"effective_cache_size"`
	HugePages          string `form:"huge_pages" json:"huge_pages"`
	// WAL 设置
	WalLevel                   string `form:"wal_level" json:"wal_level"`
	WalBuffers                 string `form:"wal_buffers" json:"wal_buffers"`
	MaxWalSize                 string `form:"max_wal_size" json:"max_wal_size"`
	MinWalSize                 string `form:"min_wal_size" json:"min_wal_size"`
	CheckpointCompletionTarget string `form:"checkpoint_completion_target" json:"checkpoint_completion_target"`
	// 查询优化
	DefaultStatisticsTarget string `form:"default_statistics_target" json:"default_statistics_target"`
	RandomPageCost          string `form:"random_page_cost" json:"random_page_cost"`
	EffectiveIoConcurrency  string `form:"effective_io_concurrency" json:"effective_io_concurrency"`
	// 日志设置
	LogDestination          string `form:"log_destination" json:"log_destination"`
	LogMinDurationStatement string `form:"log_min_duration_statement" json:"log_min_duration_statement"`
	LogTimezone             string `form:"log_timezone" json:"log_timezone"`
	// IO 设置
	IoMethod string `form:"io_method" json:"io_method"`
}

ConfigTune PostgreSQL 配置调整

type SetPostgresPassword

type SetPostgresPassword struct {
	Password string `form:"password" json:"password" validate:"required|password"`
}

type UpdateConfig

type UpdateConfig struct {
	Config string `form:"config" json:"config" validate:"required"`
}

Jump to

Keyboard shortcuts

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