pdb-schema-generate

command
v1.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Command pdb-schema-generate reads the hand-curated schema/peeringdb.json and writes the entgo schema files. It writes one file for each PeeringDB type, named for the model in lower case (for example ent/schema/networkixlan.go), and the shared ent/schema/types.go.

The tool overwrites these files on every run and removes hand edits. Put hand-written schema methods in sibling files named {type}_{method}.go, for example ent/schema/poc_policy.go. ent/generate.go runs this tool in its first go:generate step.

Usage:

pdb-schema-generate <schema.json> [output-dir]

The default output-dir is "ent/schema", relative to the working directory. The tool formats the generated files with go/format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL