Documentation
¶
Index ¶
- func GetDatabaseConfigSchema() (map[string]interface{}, error)
- func GetPGAuditSchema() (map[string]interface{}, error)
- func GetPGAuditSchemaJSON() []byte
- func GetPgBouncerSchema() (map[string]interface{}, error)
- func GetPgBouncerSchemaJSON() []byte
- func GetPgHBASchema() (map[string]interface{}, error)
- func GetPgHBASchemaJSON() []byte
- func GetPgconfigSchemaJSON() []byte
- func GetPostgRESTSchema() (map[string]interface{}, error)
- func GetPostgRESTSchemaJSON() []byte
- func GetSchema(schemaType SchemaType) (map[string]interface{}, error)
- func GetSchemaJSON(schemaType SchemaType) ([]byte, error)
- func GetWalGSchema() (map[string]interface{}, error)
- func GetWalGSchemaJSON() []byte
- func ValidateAgainstSchema(data interface{}, schemaType SchemaType) error
- type Param
- type SchemaType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabaseConfigSchema ¶
GetDatabaseConfigSchema returns the DatabaseConfig schema as a map This is typically a definition within the PgBouncer schema
func GetPGAuditSchema ¶
GetPGAuditSchema returns the parsed PGAudit schema as a map
func GetPGAuditSchemaJSON ¶
func GetPGAuditSchemaJSON() []byte
GetPGAuditSchemaJSON returns the raw JSON bytes for the PGAudit schema
func GetPgBouncerSchema ¶
GetPgBouncerSchema returns the parsed PgBouncer schema as a map
func GetPgBouncerSchemaJSON ¶
func GetPgBouncerSchemaJSON() []byte
GetPgBouncerSchemaJSON returns the raw JSON bytes for the PgBouncer schema
func GetPgHBASchema ¶
GetPgHBASchema returns the parsed pg_hba.conf schema as a map
func GetPgHBASchemaJSON ¶
func GetPgHBASchemaJSON() []byte
GetPgHBASchemaJSON returns the raw JSON bytes for the pg_hba.conf schema
func GetPgconfigSchemaJSON ¶
func GetPgconfigSchemaJSON() []byte
GetPgconfigSchemaJSON returns the raw JSON bytes for the main pgconfig schema
func GetPostgRESTSchema ¶
GetPostgRESTSchema returns the parsed PostgREST schema as a map
func GetPostgRESTSchemaJSON ¶
func GetPostgRESTSchemaJSON() []byte
GetPostgRESTSchemaJSON returns the raw JSON bytes for the PostgREST schema
func GetSchema ¶
func GetSchema(schemaType SchemaType) (map[string]interface{}, error)
GetSchema returns the parsed schema as a map for a given schema type
func GetSchemaJSON ¶
func GetSchemaJSON(schemaType SchemaType) ([]byte, error)
GetSchemaJSON returns the raw JSON bytes for a given schema type
func GetWalGSchema ¶
GetWalGSchema returns the parsed WAL-G schema as a map
func GetWalGSchemaJSON ¶
func GetWalGSchemaJSON() []byte
GetWalGSchemaJSON returns the raw JSON bytes for the WAL-G schema
func ValidateAgainstSchema ¶
func ValidateAgainstSchema(data interface{}, schemaType SchemaType) error
ValidateAgainstSchema validates data against a schema
Types ¶
type Param ¶
type Param struct {
Name string `json:"name"` // Parameter name (e.g., "shared_buffers")
VarType string `json:"vartype"` // Type: bool, enum, integer, real, string
Unit string `json:"unit"` // Unit: kB, MB, GB, s, ms, min, etc.
Category string `json:"category"` // Category path (e.g., "Write-Ahead Log / Settings")
ShortDesc string `json:"short_desc"` // Short description
ExtraDesc string `json:"extra_desc"` // Extended description
Context string `json:"context"` // When can be changed: postmaster, sighup, backend, superuser, user
VarClass string `json:"varclass"` // Class: configuration, preset, fixed
MinVal float64 `json:"min_val"` // Minimum value (for numeric types)
MaxVal float64 `json:"max_val"` // Maximum value (for numeric types)
EnumVals []string `json:"enum_vals"` // Valid enum values (for enum types)
BootVal string `json:"boot_val"` // Default/boot value
Setting string `json:"setting"` // Current setting value
SourceFile string `json:"source_file"` // Configuration source file
SourceLine string `json:"source_line"` // Line number in source file
PendingRestart bool `json:"pending_restart"` // Whether change requires restart
}
Param represents a PostgreSQL configuration parameter with all its metadata
func FilterParamsByCategory ¶
FilterParamsByCategory returns parameters that belong to the specified category
func FilterParamsByContext ¶
FilterParamsByContext returns parameters that can be changed in the specified context
func GetParamByName ¶
GetParamByName returns a parameter by name from a slice of parameters
func ParseDescribeConfig ¶
ParseDescribeConfig parses the output of `postgres --describe-config` The output is tab-separated values with the following fields (PostgreSQL 17+): name, context, category, vartype, boot_val, min_val, max_val, short_desc, extra_desc
func (*Param) ValidateParamValue ¶
ValidateParamValue validates a parameter value against its constraints
type SchemaType ¶
type SchemaType string
SchemaType represents the type of schema
const ( SchemaTypePgConfig SchemaType = "pgconfig" SchemaTypePgBouncer SchemaType = "pgbouncer" SchemaTypePostgREST SchemaType = "postgrest" SchemaTypeWalG SchemaType = "walg" SchemaTypePGAudit SchemaType = "pgaudit" SchemaTypePgHBA SchemaType = "pghba" )
func GetAllSchemaTypes ¶
func GetAllSchemaTypes() []SchemaType
GetAllSchemaTypes returns all available schema types