Documentation
¶
Overview ¶
Package metadata exposes shared helpers for metadata-aware and offline interface adapters. input: transport-layer connection inputs, secret lookup sources, and offline-audit context needs output: normalized connection helpers plus the shared offline existence caveat for interface adapters pos: shared helper boundary used by CLI, HTTP, and MCP transports note: if this file changes, update this header and module README.md.
Package metadata exposes shared helpers for metadata-aware and offline interface adapters. input: transport-layer connection inputs and offline-audit context needs output: connection helpers plus the shared offline existence caveat for CLI, HTTP, and MCP pos: shared interface-adapter helpers used when a transport did not attach a snapshot note: if this file changes, update this header and module README.md.
Index ¶
- Constants
- func ExpandHome(path string) (string, error)
- func IsConnectionInputError(err error) bool
- func OfflineExistenceUnproven() []string
- func ParseConnectTimeout(input ConnectionInput) (time.Duration, bool, error)
- func ResolvePassword(input ConnectionInput, options ResolveConnectionOptions) (string, error)
- func ValidateConnectionInput(input ConnectionInput) error
- type ConnectionInput
- type ConnectionInputError
- type ErrorKind
- type ResolveConnectionOptions
Constants ¶
const ExistenceNotCheckedNote = "existence not checked (no database connection)"
ExistenceNotCheckedNote is the offline limitation on CLI, HTTP, and MCP context when the adapter did not attach a table snapshot.
Variables ¶
This section is empty.
Functions ¶
func ExpandHome ¶
ExpandHome expands a leading ~ in path values.
func IsConnectionInputError ¶
IsConnectionInputError reports whether err is a shared direct-connection input failure.
func OfflineExistenceUnproven ¶ added in v0.490.0
func OfflineExistenceUnproven() []string
OfflineExistenceUnproven lists schema facts the offline path did not prove.
func ParseConnectTimeout ¶ added in v0.63.0
func ParseConnectTimeout(input ConnectionInput) (time.Duration, bool, error)
ParseConnectTimeout parses the ConnectTimeout field from a ConnectionInput. Empty/zero returns (0, false, nil). Invalid/negative durations return a ConnectionInputError.
func ResolvePassword ¶
func ResolvePassword(input ConnectionInput, options ResolveConnectionOptions) (string, error)
ResolvePassword resolves a password from direct, env, or file sources.
func ValidateConnectionInput ¶
func ValidateConnectionInput(input ConnectionInput) error
ValidateConnectionInput validates direct connection input shape and transport constraints.
Types ¶
type ConnectionInput ¶
type ConnectionInput struct {
Host string `json:"host,omitempty" yaml:"host"`
Port int `json:"port,omitempty"`
Socket string `json:"socket,omitempty" yaml:"socket"`
User string `json:"user,omitempty" yaml:"user"`
Schema string `json:"schema,omitempty" yaml:"schema"`
Dialect string `json:"dialect,omitempty" yaml:"dialect"`
Password string `json:"password,omitempty" yaml:"password"`
PasswordEnv string `json:"password_env,omitempty" yaml:"password_env"`
PasswordFile string `json:"password_file,omitempty" yaml:"password_file"`
ConnectTimeout string `json:"connect_timeout,omitempty" yaml:"connect_timeout"`
}
ConnectionInput describes one direct metadata-aware connection input.
type ConnectionInputError ¶
ConnectionInputError preserves the user-facing message while exposing adapter-safe classification.
func (*ConnectionInputError) Error ¶
func (e *ConnectionInputError) Error() string
func (*ConnectionInputError) Unwrap ¶
func (e *ConnectionInputError) Unwrap() error