chore: phase 3 code quality — pipeline prefixes, godoc baseline
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
// Package pipeline ingests module inputs (CDN, ASN, domains, IP ranges), materializes
|
||||
// prefixes, and creates BIRD preview revisions via store.
|
||||
package pipeline
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
// moduleIngestInputHash fingerprints module config and child entries so snapshots invalidate on CRUD.
|
||||
func moduleIngestInputHash(st store.Backend, tenantID string, mod *store.Module) (string, error) {
|
||||
if st == nil || mod == nil {
|
||||
return "", fmt.Errorf("module hash: missing store or module")
|
||||
return "", fmt.Errorf("pipeline: module hash: missing store or module")
|
||||
}
|
||||
h := sha256.New()
|
||||
_, _ = fmt.Fprintf(h, "type=%s\n", strings.TrimSpace(mod.Type))
|
||||
|
||||
@@ -52,7 +52,7 @@ func RefreshModuleIngest(ctx context.Context, st store.Backend, hc *http.Client,
|
||||
return err
|
||||
}
|
||||
if !mod.Enabled {
|
||||
return fmt.Errorf("module disabled")
|
||||
return fmt.Errorf("pipeline: module disabled")
|
||||
}
|
||||
|
||||
var prior []store.PrefixRow
|
||||
@@ -185,7 +185,7 @@ func collectModulePrefixRows(ctx context.Context, st store.Backend, hc *http.Cli
|
||||
}
|
||||
return collectDomainPrefixRows(ctx, hc, mod, profiles, policy, entries)
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown module type %q", mod.Type)
|
||||
return nil, fmt.Errorf("pipeline: unknown module type %q", mod.Type)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,5 +76,5 @@ func PickTenantRefreshTriggerModule(st store.Backend, tenantID string, moduleIDs
|
||||
return mod.ID, nil
|
||||
}
|
||||
}
|
||||
return "", fmt.Errorf("no enabled module for tenant refresh")
|
||||
return "", fmt.Errorf("pipeline: no enabled module for tenant refresh")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user