Documentation
¶
Overview ¶
Package auditmeta prepares metadata-aware audit requests for multiple adapters. input: MySQL-compatible metadata connections and provider methods from infrastructure adapters output: shared client wrapper implementing the metadata preparation client contract pos: infrastructure-backed client bridge for shared metadata-aware audit preparation note: if this file changes, update this header and module README.md.
Package auditmeta prepares metadata-aware audit requests for multiple adapters. input: metadata-preparation failures encountered while opening connections, validating dialects, and resolving schemas output: typed shared errors, including MySQL/TiDB alias conflicts and PostgreSQL schema/database validation, that let adapters classify metadata-prep failures without brittle string matching pos: shared error taxonomy for CLI and MCP metadata-aware preparation flows note: if this file changes, update this header and module README.md.
Package auditmeta prepares metadata-aware audit requests for multiple adapters. input: audit SQL text, requested dialect/schema preferences, metadata connection configs, and metadata clients output: prepared metadata-aware audit context with opened client, connresolve MySQL/TiDB catalog aliases, or bounded MySQL/TiDB and PostgreSQL connection validation errors pos: shared application helper between transport adapters and the core audit service note: if this file changes, update this header and module README.md.
Package auditmeta prepares metadata-aware audit requests for multiple adapters. input: parsed and partially parsed SQL statements plus normalized statement specs from the audit application layer output: Mutation Target facts from valid statements used for schema inference before metadata-aware audit execution pos: shared SQL target inference helper for metadata-aware adapters note: if this file changes, update this header and module README.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
appaudit.MetadataProvider
DetectDialect(ctx context.Context) (spec.Dialect, error)
FindSchemasForTable(ctx context.Context, table string) ([]string, error)
Close() error
}
Client describes the metadata-aware capabilities required before audit execution.
func OpenClient ¶ added in v0.18.0
func OpenClient(config ConnectionConfig) (Client, error)
OpenClient opens a shared metadata client for the requested dialect.
type ConnectionConfig ¶
type ConnectionConfig struct {
Host string
Port int
Socket string
User string
Password string
Database string
Dialect spec.Dialect
ConnectTimeout time.Duration
TLSMode string // "disabled" (default) or "enabled"
CACert *x509.CertPool // pre-parsed CA pool; only used when tls_mode=enabled
}
ConnectionConfig describes one metadata-aware connection opening request.
type ErrorKind ¶
type ErrorKind string
ErrorKind classifies one metadata-preparation failure.
const ( ErrorInvalidSQL ErrorKind = "invalid_sql" ErrorDialectMismatch ErrorKind = "dialect_mismatch" ErrorSchemaHintRequired ErrorKind = "schema_hint_required" ErrorSchemaLookupFailed ErrorKind = "schema_lookup_failed" ErrorConnectionOpen ErrorKind = "connection_open_failed" ErrorDialectDetect ErrorKind = "dialect_detect_failed" ErrorPostgreSQLDatabaseRequired ErrorKind = "postgresql_database_required" ErrorMySQLDatabaseSchemaConflict ErrorKind = "mysql_database_schema_conflict" )
type PreparedAudit ¶
type PreparedAudit struct {
Client Client
Dialect spec.Dialect
Schema string
DialectSource string
SchemaSource string
}
PreparedAudit captures the shared metadata-aware audit context needed by adapters.
type Request ¶
type Request struct {
SQL string
Connection ConnectionConfig
RequestedDialect spec.Dialect
ExplicitDialect bool
ExplicitSchema string
ExplicitSchemaSource string
SchemaHint string
OpenClient func(ConnectionConfig) (Client, error)
}
Request describes one shared metadata-aware audit preparation request.