depgraph

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

TODO(uv): this is copied from the `dep-graph-go` library. We should open-source that code and import it here.

TODO(uv): this is copied from the `dep-graph-go` library. We should open-source that code and import it here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(pkgManager *PkgManager, rootPkg *PkgInfo) (*Builder, error)

func (*Builder) AddNode

func (b *Builder) AddNode(nodeID string, pkgInfo *PkgInfo) *Node

func (*Builder) Build

func (b *Builder) Build() *DepGraph

func (*Builder) ConnectNodes

func (b *Builder) ConnectNodes(parentNodeID, childNodeID string) error

func (*Builder) GetPkgManager

func (b *Builder) GetPkgManager() *PkgManager

func (*Builder) GetPkgs

func (b *Builder) GetPkgs() []Pkg

func (*Builder) GetRootNode

func (b *Builder) GetRootNode() *Node

type DepGraph

type DepGraph struct {
	SchemaVersion string     `json:"schemaVersion"`
	PkgManager    PkgManager `json:"pkgManager"`
	Pkgs          []Pkg      `json:"pkgs"`
	Graph         Graph      `json:"graph"`
	// contains filtered or unexported fields
}

func New

func New() *DepGraph

func UnmarshalJSON

func UnmarshalJSON(data []byte) (*DepGraph, error)

func (*DepGraph) GetPkg

func (dg *DepGraph) GetPkg(id string) (*Pkg, bool)

func (*DepGraph) GetRootPkg

func (dg *DepGraph) GetRootPkg() *Pkg

func (*DepGraph) MarshalJSON

func (dg *DepGraph) MarshalJSON() ([]byte, error)

type Dependency

type Dependency struct {
	NodeID string `json:"nodeId"`
}

type Graph

type Graph struct {
	RootNodeID string `json:"rootNodeId"`
	Nodes      []Node `json:"nodes"`
}

type Node

type Node struct {
	NodeID string       `json:"nodeId"`
	PkgID  string       `json:"pkgId"`
	Info   *NodeInfo    `json:"info,omitempty"`
	Deps   []Dependency `json:"deps"`
}

type NodeInfo

type NodeInfo struct {
	VersionProvenance *VersionProvenance `json:"versionProvenance,omitempty"`
	Labels            map[string]string  `json:"labels,omitempty"`
}

type Pkg

type Pkg struct {
	ID   string  `json:"id"`
	Info PkgInfo `json:"info"`
}

type PkgInfo

type PkgInfo struct {
	Name       string `json:"name"`
	Version    string `json:"version,omitempty"`
	PackageURL string `json:"purl,omitempty"`
}

type PkgManager

type PkgManager struct {
	Name         string       `json:"name"`
	Version      string       `json:"version,omitempty"`
	Repositories []Repository `json:"repositories,omitempty"`
}

type Property

type Property struct {
	Name string `json:"name"`
}

type Repository

type Repository struct {
	Alias string `json:"alias"`
}

type VersionProvenance

type VersionProvenance struct {
	Type     string    `json:"type"`
	Location string    `json:"location"`
	Property *Property `json:"property,omitempty"`
}

Jump to

Keyboard shortcuts

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