Documentation
¶
Index ¶
- type Config
- type Mapper
- func (m *Mapper) ApplyTransformation(value interface{}, transformationName string) (interface{}, error)
- func (m *Mapper) ExtractParameters(jwtClaims types.JWTClaims, inputMapping []types.InputMapping) (map[string]interface{}, error)
- func (m *Mapper) GetSupportedTransformations() []string
- func (m *Mapper) TransformResults(rawData map[string]interface{}, outputMapping []types.OutputMapping) (map[string]interface{}, error)
- func (m *Mapper) ValidateInputMapping(inputMapping []types.InputMapping) error
- func (m *Mapper) ValidateOutputMapping(outputMapping []types.OutputMapping) error
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) GetMapper() types.Mapper
- func (p *Provider) HealthCheck(ctx context.Context) error
- func (p *Provider) Name() string
- func (p *Provider) ResolveEntity(ctx context.Context, strategy types.MappingStrategy, ...) (*types.RawResult, error)
- func (p *Provider) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Database connection configuration
Driver string `mapstructure:"driver"` // "postgres", "mysql", "sqlite"
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Database string `mapstructure:"database"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
SSLMode string `mapstructure:"ssl_mode"`
// Connection pool settings
MaxOpenConnections int `mapstructure:"max_open_connections"`
MaxIdleConnections int `mapstructure:"max_idle_connections"`
ConnMaxLifetime time.Duration `mapstructure:"connection_max_lifetime"`
ConnMaxIdleTime time.Duration `mapstructure:"connection_max_idle_time"`
// Query settings
QueryTimeout time.Duration `mapstructure:"query_timeout"`
// Health check settings
HealthCheckQuery string `mapstructure:"health_check_query"`
HealthCheckTime time.Duration `mapstructure:"health_check_timeout"`
// Description for this SQL provider instance
Description string `mapstructure:"description"`
}
SQLConfig defines configuration for SQL database providers
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper handles mapping for SQL providers
func (*Mapper) ApplyTransformation ¶
func (m *Mapper) ApplyTransformation(value interface{}, transformationName string) (interface{}, error)
ApplyTransformation applies SQL-specific transformations
func (*Mapper) ExtractParameters ¶
func (m *Mapper) ExtractParameters(jwtClaims types.JWTClaims, inputMapping []types.InputMapping) (map[string]interface{}, error)
ExtractParameters extracts parameters for SQL queries with proper validation
func (*Mapper) GetSupportedTransformations ¶
GetSupportedTransformations returns SQL-specific transformations
func (*Mapper) TransformResults ¶
func (m *Mapper) TransformResults(rawData map[string]interface{}, outputMapping []types.OutputMapping) (map[string]interface{}, error)
TransformResults transforms SQL query results to standardized claims
func (*Mapper) ValidateInputMapping ¶
func (m *Mapper) ValidateInputMapping(inputMapping []types.InputMapping) error
ValidateInputMapping validates SQL-specific input mapping requirements
func (*Mapper) ValidateOutputMapping ¶
func (m *Mapper) ValidateOutputMapping(outputMapping []types.OutputMapping) error
ValidateOutputMapping validates SQL-specific output mapping requirements
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the Provider interface for SQL databases
func NewProvider ¶
NewProvider creates a new SQL provider
func (*Provider) HealthCheck ¶
HealthCheck verifies the SQL database is accessible