Documentation
¶
Overview ¶
Package seed provides deterministic test data seeding for PeeringDB entity types. It creates well-known entities with fixed IDs so that any test package can populate a database with realistic data via a single function call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Timestamp = time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC)
Timestamp is the deterministic timestamp used for all seed entity created/updated fields.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Org *ent.Organization
Network *ent.Network
Network2 *ent.Network // second network, only in Full
IX *ent.InternetExchange
Facility *ent.Facility
Facility2 *ent.Facility // campus-assigned facility, only in Full
Campus *ent.Campus
Carrier *ent.Carrier
IxLan *ent.IxLan
IxPrefix *ent.IxPrefix
NetworkIxLan *ent.NetworkIxLan
NetworkFacility *ent.NetworkFacility
IxFacility *ent.IxFacility
CarrierFacility *ent.CarrierFacility
Poc *ent.Poc
// UsersPoc is a visible="Users" POC attached to r.Network. Created via
// privacy.DecisionContext(Allow) because ent Policy() admits writes
// identically to reads — future mutation policies could reject it.
// ID 9000 (reserved band 9000-9099 for Users-tier seed rows).
UsersPoc *ent.Poc
// UsersPoc2 is a visible="Users" POC attached to r.Network2. ID 9001.
UsersPoc2 *ent.Poc
// AllPocs exposes every POC created (Public + Users) in deterministic
// order: r.Poc, r.UsersPoc, r.UsersPoc2. Consumers that iterate POCs
// for assertions (list-count tests) should use this slice.
AllPocs []*ent.Poc
AllNetworks []*ent.Network // all created networks (for Networks())
}
Result holds typed references to all entities created by seed functions.
Click to show internal directories.
Click to hide internal directories.