Documentation
¶
Overview ¶
Package config defines pdbq's configuration model and its loading rules: YAML file < environment (PDBQ_*) < command-line flags.
Every field carries a `koanf` tag (its YAML/env path) and a `doc` tag; the annotated reference YAML (`pdbq config example`) is generated from these tags so documentation can never drift from the structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExampleYAML ¶
func ExampleYAML() string
ExampleYAML renders the fully-commented reference configuration from the Config struct tags and defaults, so the reference can never drift from the real config surface.
Types ¶
type Auth ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Config ¶
type Config struct {
Database Database `koanf:"database"`
Server Server `koanf:"server"`
Schema Schema `koanf:"schema"`
Filters Filters `koanf:"filters"`
RLS RLS `koanf:"rls"`
TX TX `koanf:"transactions"`
Watch Watch `koanf:"watch"`
Errors Errors `koanf:"errors"`
Plugins Plugins `koanf:"plugins"`
Log Log `koanf:"log"`
}
func Load ¶
Load builds the effective config: defaults, then optional YAML file, then PDBQ_* env vars, then flags (highest precedence). Pass only the flags the user set (confx.ChangedFlags) so unset flags do not shadow YAML/env.
func (*Config) DisabledPlugins ¶
DisabledPlugins returns the disabled-plugin set for registry filtering.
type Database ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Errors ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Filters ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Log ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Plugins ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type RLS ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Schema ¶
The shared sections (koanf paths and doc strings) live in pdbcore/confx; Server and TX (with per_request) are pdbq's own.
type Server ¶
type Server struct {
Addr string `koanf:"addr" doc:"Listen address for the HTTP server."`
GraphiQL bool `koanf:"graphiql" doc:"Serve the GraphiQL playground at / (off by default; enable for development)."`
ExposeSchema bool `` /* 160-byte string literal not displayed */
RequestTimeout time.Duration `koanf:"request_timeout" doc:"Overall HTTP request timeout."`
MaxBodyBytes int64 `koanf:"max_body_bytes" doc:"Maximum accepted request body size in bytes."`
MaxDepth int `koanf:"max_depth" doc:"Maximum GraphQL selection depth per operation."`
MaxCost int `koanf:"max_cost" doc:"Maximum estimated cost (selected fields x list multipliers) per operation."`
MaxPageSize int `` /* 140-byte string literal not displayed */
CORSOrigins []string `` /* 129-byte string literal not displayed */
Compression bool `koanf:"compression" doc:"Gzip responses for clients that send Accept-Encoding: gzip (off by default)."`
APQ bool `` /* 179-byte string literal not displayed */
PersistedQueriesPath string `` /* 142-byte string literal not displayed */
PersistedOnly bool `` /* 159-byte string literal not displayed */
ReadOnly bool `` /* 195-byte string literal not displayed */
DisableIntrospection bool `` /* 173-byte string literal not displayed */
}
type TX ¶
type TX struct {
Mutations bool `koanf:"mutations" doc:"Wrap every mutation in a transaction."`
PerRequest bool `koanf:"per_request" doc:"Use one transaction for the whole request instead of one per operation."`
Isolation string `koanf:"isolation" doc:"Transaction isolation level: read_committed, repeatable_read, serializable."`
MaxRetries int `` /* 233-byte string literal not displayed */
}