graph

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package graph builds deterministic dependency graphs from native Ramen resources without reading state or invoking an executor.

The graph package is part of Ramen's supported v0.1 core API.

Index

Constants

View Source
const DocumentVersion = "ramen.graph.v1"

Variables

This section is empty.

Functions

func DOT

func DOT(doc Document) string

Types

type Diagnostic

type Diagnostic struct {
	Code          string `json:"code"`
	Severity      string `json:"severity"`
	Message       string `json:"message"`
	Address       string `json:"address,omitempty"`
	APISourceKind string `json:"api_source_kind,omitempty"`
	APISourceID   string `json:"api_source_id,omitempty"`
	OperationID   string `json:"operation_id,omitempty"`
}

type Document

type Document struct {
	Version     string       `json:"version"`
	ProjectPath string       `json:"project_path,omitempty"`
	Nodes       []GraphNode  `json:"nodes,omitempty"`
	Edges       []GraphEdge  `json:"edges,omitempty"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}

func BuildProject

func BuildProject(doc *project.Document) Document

type GraphEdge

type GraphEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
	Type string `json:"type"`
}

type GraphNode

type GraphNode struct {
	Address    string         `json:"address"`
	Kind       string         `json:"kind,omitempty"`
	Type       string         `json:"type,omitempty"`
	Operations []OperationRef `json:"operations,omitempty"`
}

type Node

type Node struct {
	Address   string
	DependsOn []string
}

func Sort

func Sort(nodes []Node) ([]Node, error)

type OperationRef

type OperationRef struct {
	Role        string `json:"role"`
	SourceKind  string `json:"source_kind,omitempty"`
	SourceID    string `json:"source_id,omitempty"`
	OperationID string `json:"operation_id,omitempty"`
}

Jump to

Keyboard shortcuts

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