debug

package
v0.1.7-cachejson-hotfix-2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Foliage graph store debug package. Provides debug stateful functions for the graph store

Index

Constants

View Source
const (
	BODY_JSON_ATTR_ID        = "bdj"
	BODY_XML_ATTR_ID         = "bdx"
	LINK_NAME_STRING_ATTR_ID = "nms"
	LINK_TYPE_STRING_ATTR_ID = "tps"
	LINK_TAG_STRING_ATTR_ID  = "tgs"
)
View Source
const (
	MAX_ACK_WAIT_MS = 60 * 1000
)

Variables

This section is empty.

Functions

func ExtractBodyAsJSON added in v0.1.6

func ExtractBodyAsJSON(attrs []RawAttributeInnerXML) (easyjson.JSON, error)

func ExtractEdgeTypeAndNameAndTags added in v0.1.6

func ExtractEdgeTypeAndNameAndTags(attrs []RawAttributeInnerXML) (tp string, name string, tags []string)

func LLAPIImportGraph added in v0.1.6

func LLAPIImportGraph(executor sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)

format: string // "graphml" source: string // "file" | "payload" data: string // "graph data" | "file path"

Example: nats -s nats://nats:foliage@nats:4222 pub signal.hub.functions.graph.api.import.a "{\"payload\":{\"format\":\"graphml\",\"source\":\"file\",\"data\":\"./skala-xml.graphml\"}}"

func LLAPIPrintGraph added in v0.1.1

func LLAPIPrintGraph(executor sfPlugins.StatefunExecutor, ctx *sfPlugins.StatefunContextProcessor)

Print Graph from certain id using Graphviz

Algorithm: Sync BFS

Payload: {
	"depth": uint // optional, default: -1
	"format": string // "dot" | "graphml" - optional, default: "dot"
	"json2xml": bool // whether to export bodies as json or xml (graphml only) - optional, default false
	"exclude": { // Fields to exclude during export, optional
		"vertex": ["__meta", "fieldX.fieldY" ...] // optional
		"edge": ["field1", ...] // optional
	}
}

func RegisterAllFunctionTypes

func RegisterAllFunctionTypes(runtime *statefun.Runtime)

Types

type AttributeCharData added in v0.1.6

type AttributeCharData struct {
	XMLName xml.Name    `xml:"data"`
	Key     string      `xml:"key,attr"`
	Data    interface{} `xml:",chardata"`
}

type AttributeInnerXML added in v0.1.6

type AttributeInnerXML struct {
	XMLName xml.Name    `xml:"data"`
	Key     string      `xml:"key,attr"`
	Data    interface{} `xml:",innerxml"`
}

type Edge added in v0.1.6

type Edge struct {
	XMLName    xml.Name      `xml:"edge"`
	Source     string        `xml:"source,attr"`
	Target     string        `xml:"target,attr"`
	Attributes []interface{} `xml:"data"`
}

type Element added in v0.1.6

type Element struct {
	XMLName xml.Name  `xml:"v"`
	Key     string    `xml:"key,attr"`
	Type    string    `xml:"type,attr,omitempty"`
	Content string    `xml:",chardata"`
	Items   []Element `xml:",any"`
}

func ConvertToXML added in v0.1.6

func ConvertToXML(name string, value interface{}) []Element

type Graph added in v0.1.6

type Graph struct {
	XMLName     xml.Name `xml:"graph"`
	Id          string   `xml:"id,attr"`
	Edgedefault string   `xml:"edgedefault,attr"`
	Nodes       []Node   `xml:"node"`
	Edges       []Edge   `xml:"edge"`
}

type GraphML added in v0.1.6

type GraphML struct {
	XMLName xml.Name `xml:"graphml"`
	Xmlns   string   `xml:"xmlns,attr"`
	Keys    []Key    `xml:"key"`
	Graph   Graph    `xml:"graph"`
}

type Key added in v0.1.6

type Key struct {
	XMLName  xml.Name `xml:"key"`
	Id       string   `xml:"id,attr"`
	For      string   `xml:"for,attr"`
	AttrName string   `xml:"attr.name,attr"`
	AttrType string   `xml:"attr.type,attr"`
}

type Node added in v0.1.6

type Node struct {
	XMLName    xml.Name      `xml:"node"`
	Id         string        `xml:"id,attr"`
	Attributes []interface{} `xml:"data"`
}

type RawAttributeInnerXML added in v0.1.6

type RawAttributeInnerXML struct {
	XMLName xml.Name     `xml:"data"`
	Key     string       `xml:"key,attr"`
	Data    xml.CharData `xml:",innerxml"`
}

type RawEdge added in v0.1.6

type RawEdge struct {
	XMLName    xml.Name               `xml:"edge"`
	Source     string                 `xml:"source,attr"`
	Target     string                 `xml:"target,attr"`
	Attributes []RawAttributeInnerXML `xml:"data"`
}

type RawGraph added in v0.1.6

type RawGraph struct {
	XMLName     xml.Name  `xml:"graph"`
	Id          string    `xml:"id,attr"`
	Edgedefault string    `xml:"edgedefault,attr"`
	Nodes       []RawNode `xml:"node"`
	Edges       []RawEdge `xml:"edge"`
}

func ImportGraphML added in v0.1.6

func ImportGraphML(r io.Reader) (RawGraph, error)

type RawGraphML added in v0.1.6

type RawGraphML struct {
	XMLName xml.Name `xml:"graphml"`
	Graph   RawGraph `xml:"graph"`
}

type RawNode added in v0.1.6

type RawNode struct {
	XMLName    xml.Name               `xml:"node"`
	Id         string                 `xml:"id,attr"`
	Attributes []RawAttributeInnerXML `xml:"data"`
}

Jump to

Keyboard shortcuts

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