seed

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

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
	AllNetworks     []*ent.Network // all created networks (for Networks())
}

Result holds typed references to all entities created by seed functions.

func Full

func Full(tb testing.TB, client *ent.Client) *Result

Full creates one entity of each of the 13 PeeringDB types plus a second Network and a campus-assigned Facility. It uses deterministic IDs matching the legacy seedAllTestData pattern for backward compatibility.

Jump to

Keyboard shortcuts

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