Documentation
¶
Overview ¶
Package metadata exposes shared direct-connection helpers for metadata-aware interface adapters. input: transport-layer connection inputs and secret lookup sources output: normalized validation and password resolution helpers for interface adapters pos: shared connection helper boundary used by MCP and future metadata-aware transports note: if this file changes, update this header and module README.md.
Index ¶
- func ExpandHome(path string) (string, error)
- func IsConnectionInputError(err error) bool
- 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 ¶
This section is empty.
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 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