{"modulePath":"github.com/nvidia/doca-platform/hack/tools/dpfdev","version":"v0.0.0-20261202020107-608af116a20f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package htmlreport\n\nPackage htmlreport generates a static HTML viewer for artifact directories collected by dpfdev collect. Artifacts have the structure:\n\n\t\u003cartifactDir\u003e/\u003ccluster\u003e/Resources/\u003cKind\u003e/[\u003cnamespace\u003e/]\u003cname\u003e.yaml\n\t\u003cartifactDir\u003e/\u003ccluster\u003e/Events/\u003cKind\u003e/\u003cnamespace\u003e/\u003cname\u003e.events\n\n## Functions\n\n```go\nfunc DiscoverDumps(root string) ([]string, error)\n```\nDiscoverDumps walks root and returns the resource dump directories found underneath it. A dump is a directory whose \\\u003ccluster\u003e children contain a Resources/ or Events/ section directory, i.e. the grandparent of any such section directory (\\\u003cdump\u003e/\\\u003ccluster\u003e/Resources). The returned paths are de-duplicated and sorted.\n\nPointing DiscoverDumps at a single dump directory returns that directory itself, so callers can pass either an artifact root containing many dumps (e.g. .../data with pre-/post-cleanup dumps) or one dump directory directly.\n\n```go\nfunc DiscoverLogDirs(root string) ([]string, error)\n```\nDiscoverLogDirs walks root and returns every directory named \"logs\" found underneath it, sorted. Multi-phase jobs run each phase with its own ARTIFACTS\\_DIR (e.g. artifacts/before, artifacts/after), so a single artifact root can hold several log trees rather than just \\\u003croot\u003e/logs. Nested logs/ directories are not descended into, and resource dump sections are skipped.\n\n```go\nfunc Generate(root string, dumps []string, outputPath string) error\n```\nGenerate builds a single artifacts-browser.html at outputPath covering every resource dump in dumps (as returned by DiscoverDumps). File references in the page are relative to root, so the generated HTML must be served from root with the dump directories beneath it.\n\nAll paths are resolved to absolute before use so that relative inputs work.\n\n## Types\n\n```go\ntype CILog struct {\n\tPath string `json:\"p\"` // path relative to the traversed root, used for fetch()\n\tName string `json:\"n\"` // file name\n}\n```\nCILog is a top-level \\*.log file (CI job step log) directly under the root.\n\n```go\nfunc DiscoverCILogs(root string) ([]*CILog, error)\n```\nDiscoverCILogs lists the \\*.log files under root that are not container logs (CI job step logs). Container logs live under logs/ directories and are indexed by buildLogs instead, so those trees are skipped. Everything else is walked because multi-phase jobs write their step logs into per-phase subdirectories. Names are the paths relative to root.\n\n```go\ntype ClusterIndex struct {\n\tName      string       `json:\"name\"`\n\tResources []*KindGroup `json:\"resources\"`\n\tEvents    []*KindGroup `json:\"events\"`\n}\n```\nClusterIndex holds the resource and event index for one cluster directory.\n\n```go\ntype DumpEntry struct {\n\tName     string          `json:\"name\"` // dump path relative to the traversed root\n\tClusters []*ClusterIndex `json:\"clusters\"`\n}\n```\nDumpEntry is one resource dump (e.g. \"pre-dpf-operator-config-cleanup\") and the clusters captured within it.\n\n```go\ntype FileEntry struct {\n\tPath              string `json:\"p\"`\n\tNamespace         string `json:\"ns,omitempty\"`\n\tName              string `json:\"n\"`\n\tConditionMessages int    `json:\"cm,omitempty\"` // 1 if a Ready condition is not True\n}\n```\nFileEntry represents a single resource or event file.\n\n```go\ntype Index struct {\n\tDir     string        `json:\"dir\"` // base name of the traversed root directory\n\tEntries []*DumpEntry  `json:\"entries\"`\n\tLogs    []*LogCluster `json:\"logs,omitempty\"`\n\tCILogs  []*CILog      `json:\"cilogs,omitempty\"`\n}\n```\nIndex is the top-level data structure serialized into the HTML page. It holds one entry per resource dump discovered under the traversed root directory, optionally the container logs found under logs/, and any top-level CI logs.\n\n```go\ntype KindGroup struct {\n\tKind       string       `json:\"k\"`\n\tDomain     string       `json:\"d\"`            // e.g. \"core\", \"k8s.io\", \"nvidia.com\"\n\tSub        string       `json:\"s,omitempty\"`  // e.g. \"admissionregistration\", \"svc.dpu\"\n\tAPIVersion string       `json:\"av,omitempty\"` // e.g. \"v1\", \"apps/v1\", \"provisioning.dpu.nvidia.com/v1alpha1\"\n\tFiles      []*FileEntry `json:\"f\"`\n}\n```\nKindGroup groups files of the same Kind within a cluster section.\n\n```go\ntype LogCluster struct {\n\tName  string      `json:\"name\"`\n\tFiles []*LogEntry `json:\"f\"`\n}\n```\nLogCluster groups container logs for one cluster directory under logs/.\n\n```go\ntype LogEntry struct {\n\tPath      string `json:\"p\"` // path relative to the traversed root, used for fetch()\n\tNamespace string `json:\"ns,omitempty\"`\n\tPod       string `json:\"pod,omitempty\"`\n\tContainer string `json:\"c\"` // container name (log file stem)\n}\n```\nLogEntry is a single container log file collected under logs/.\n\n","path":"github.com/nvidia/doca-platform/hack/tools/dpfdev/pkg/htmlreport","name":"htmlreport","synopsis":"Package htmlreport generates a static HTML viewer for artifact directories collected by dpfdev collect.","isRedistributable":true}
