Cleaned up documentation and removed stubs and TODOs throughout the application
This commit is contained in:
@@ -7,6 +7,25 @@ import (
|
||||
"gitea.maximumdirect.net/ejr/feedkit/config"
|
||||
)
|
||||
|
||||
// requireStringParam returns a non-empty string sink param.
|
||||
//
|
||||
// This helper is intentionally local to sinks rather than config so
|
||||
// driver-specific validation stays close to the adapters that use it.
|
||||
func requireStringParam(cfg config.SinkConfig, key string) (string, error) {
|
||||
v, ok := cfg.Params[key]
|
||||
if !ok {
|
||||
return "", fmt.Errorf("sink %q: params.%s is required", cfg.Name, key)
|
||||
}
|
||||
s, ok := v.(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("sink %q: params.%s must be a string", cfg.Name, key)
|
||||
}
|
||||
if strings.TrimSpace(s) == "" {
|
||||
return "", fmt.Errorf("sink %q: params.%s cannot be empty", cfg.Name, key)
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// RegisterPostgresSchemaForConfiguredSinks registers one Postgres schema for each
|
||||
// configured sink using driver=postgres.
|
||||
func RegisterPostgresSchemaForConfiguredSinks(cfg *config.Config, schema PostgresSchema) error {
|
||||
|
||||
Reference in New Issue
Block a user