Documentation
¶
Overview ¶
Package schema provides functionality for caching PostgreSQL objects' metadata eg schema of tables / views, function def etc. It monitors schema changes via notifications and maintains an in-memory representation of tables, columns, and relationships that can be efficiently queried.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) SchemaHandler ¶
SchemaHandler registers a handler on the provided mux to serve the cached schema
type ForeignKey ¶
type OpenAPIGenerator ¶
type OpenAPIGenerator struct {
// contains filtered or unexported fields
}
OpenAPIGenerator generates OpenAPI specs from the schema cache
func NewOpenAPIGenerator ¶
func NewOpenAPIGenerator(cache *Cache, baseURL string, info OpenAPIInfo) *OpenAPIGenerator
NewOpenAPIGenerator creates a new OpenAPI generator
func (*OpenAPIGenerator) GenerateSpecification ¶
func (g *OpenAPIGenerator) GenerateSpecification() map[string]any
GenerateSpecification creates a complete OpenAPI specification
func (*OpenAPIGenerator) ServeHTTP ¶
func (g *OpenAPIGenerator) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler to serve the OpenAPI specification
func (*OpenAPIGenerator) WithSecurity ¶
func (g *OpenAPIGenerator) WithSecurity(config SecurityConfig) *OpenAPIGenerator
WithSecurity configures authentication options
type OpenAPIInfo ¶
type OpenAPIInfo struct {
Title string `json:"title"`
Description string `json:"description"`
Version string `json:"version"`
Contact struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
URL string `json:"url,omitempty"`
} `json:"contact,omitzero"`
}
OpenAPIInfo contains API metadata for the OpenAPI specification
type SecurityConfig ¶
SecurityConfig defines what authentication methods to include