Extract shared types and add Regulation type with parsing methods
Move cookie banner types (CookieItem, Category, Regulation, BannerConfig, etc.) into a dedicated types.ts file. Add a coredata.Regulation type with parsing, JSON marshaling, and database scanning methods. Hardcode the geoloc-import data directory since the submodule path is fixed. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -35,10 +35,9 @@ func main() {
|
||||
}
|
||||
|
||||
func run() error {
|
||||
var (
|
||||
pgDSN string
|
||||
dataDir string
|
||||
)
|
||||
const dataDir = "pkg/geoloc/data/country-ip-blocks"
|
||||
|
||||
var pgDSN string
|
||||
|
||||
flag.StringVar(
|
||||
&pgDSN,
|
||||
@@ -46,12 +45,6 @@ func run() error {
|
||||
os.Getenv("DATABASE_URL"),
|
||||
"PostgreSQL connection URL (default: DATABASE_URL env)",
|
||||
)
|
||||
flag.StringVar(
|
||||
&dataDir,
|
||||
"data-dir",
|
||||
"pkg/geoloc/data/country-ip-blocks",
|
||||
"path to ipverse country-ip-blocks checkout",
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
if pgDSN == "" {
|
||||
|
||||
Reference in New Issue
Block a user