ladybug

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNodeNotFound         = errors.New("ladybug node not found")
	ErrRelationshipNotFound = errors.New("ladybug relationship not found")
)

Functions

This section is empty.

Types

type BatchGraph

type BatchGraph interface {
	Batch(context.Context, func(Graph) error) error
}

type Graph

type Graph interface {
	Bootstrap(context.Context, schema.GraphSchema) error
	PutNode(context.Context, Node) error
	GetNode(context.Context, string, string) (Node, error)
	ListNodes(context.Context, string, map[string]string) ([]Node, error)
	DeleteNodes(context.Context, string, map[string]string) error
	DeleteDerivedFileNodes(context.Context, string, string) error
	PutRelationship(context.Context, Relationship) error
	ListRelationships(context.Context, string, RelationshipFilter) ([]Relationship, error)
}

type MemoryGraph

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

func NewMemoryGraph

func NewMemoryGraph() *MemoryGraph

func (*MemoryGraph) Bootstrap

func (graph *MemoryGraph) Bootstrap(_ context.Context, graphSchema schema.GraphSchema) error

func (*MemoryGraph) DeleteDerivedFileNodes

func (graph *MemoryGraph) DeleteDerivedFileNodes(_ context.Context, projectID string, repoFileID string) error

func (*MemoryGraph) DeleteNodes

func (graph *MemoryGraph) DeleteNodes(_ context.Context, label string, filter map[string]string) error

func (*MemoryGraph) GetNode

func (graph *MemoryGraph) GetNode(_ context.Context, label string, id string) (Node, error)

func (*MemoryGraph) GetRelationship

func (graph *MemoryGraph) GetRelationship(_ context.Context, relationshipType string, from NodeRef, to NodeRef) (Relationship, error)

func (*MemoryGraph) ListNodes

func (graph *MemoryGraph) ListNodes(_ context.Context, label string, filter map[string]string) ([]Node, error)

func (*MemoryGraph) ListRelationships

func (graph *MemoryGraph) ListRelationships(_ context.Context, relationshipType string, filter RelationshipFilter) ([]Relationship, error)

func (*MemoryGraph) PutNode

func (graph *MemoryGraph) PutNode(_ context.Context, node Node) error

func (*MemoryGraph) PutRelationship

func (graph *MemoryGraph) PutRelationship(_ context.Context, relationship Relationship) error

func (*MemoryGraph) SchemaSnapshot

func (graph *MemoryGraph) SchemaSnapshot() schema.GraphSchema

type NativeRuntimeStatus

type NativeRuntimeStatus struct {
	Available bool
	Reason    string
}

func NativeStatus

func NativeStatus() NativeRuntimeStatus

type Node

type Node struct {
	Label      string
	ID         string
	Properties map[string]string
}

type NodeRef

type NodeRef struct {
	Label string
	ID    string
}

type PersistentGraph

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

func OpenPersistentGraph

func OpenPersistentGraph(path string) (*PersistentGraph, error)

func (*PersistentGraph) Batch

func (graph *PersistentGraph) Batch(ctx context.Context, fn func(Graph) error) error

func (*PersistentGraph) Bootstrap

func (graph *PersistentGraph) Bootstrap(ctx context.Context, graphSchema schema.GraphSchema) error

func (*PersistentGraph) DeleteDerivedFileNodes

func (graph *PersistentGraph) DeleteDerivedFileNodes(ctx context.Context, projectID string, repoFileID string) error

func (*PersistentGraph) DeleteNodes

func (graph *PersistentGraph) DeleteNodes(ctx context.Context, label string, filter map[string]string) error

func (*PersistentGraph) GetNode

func (graph *PersistentGraph) GetNode(ctx context.Context, label string, id string) (Node, error)

func (*PersistentGraph) GetRelationship

func (graph *PersistentGraph) GetRelationship(ctx context.Context, relationshipType string, from NodeRef, to NodeRef) (Relationship, error)

func (*PersistentGraph) ListNodes

func (graph *PersistentGraph) ListNodes(ctx context.Context, label string, filter map[string]string) ([]Node, error)

func (*PersistentGraph) ListRelationships

func (graph *PersistentGraph) ListRelationships(ctx context.Context, relationshipType string, filter RelationshipFilter) ([]Relationship, error)

func (*PersistentGraph) PutNode

func (graph *PersistentGraph) PutNode(ctx context.Context, node Node) error

func (*PersistentGraph) PutRelationship

func (graph *PersistentGraph) PutRelationship(ctx context.Context, relationship Relationship) error

func (*PersistentGraph) SchemaSnapshot

func (graph *PersistentGraph) SchemaSnapshot() schema.GraphSchema

type Relationship

type Relationship struct {
	Type       string
	From       NodeRef
	To         NodeRef
	Properties map[string]string
}

type RelationshipFilter

type RelationshipFilter struct {
	From       *NodeRef
	To         *NodeRef
	Properties map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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