From 18d07bdc1d53f8132ce319aa0b1ad1ad3a4f98c7 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 12 Aug 2026 09:52:25 -0400 Subject: [PATCH] update code header format --- cypher.go | 4 ---- graph.go | 16 ++++++++-------- schema.go | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/cypher.go b/cypher.go index fcdca76..21aa228 100644 --- a/cypher.go +++ b/cypher.go @@ -5,10 +5,6 @@ import ( "strings" ) -// ======================================== -// Cypher Formatting Functions -// ======================================== - // ToCypherLabel converts a node label or relationship type into its Cypher // format. func ToCypherLabel(label string) string { diff --git a/graph.go b/graph.go index bac7275..f91f579 100644 --- a/graph.go +++ b/graph.go @@ -4,16 +4,16 @@ import ( "fmt" ) -// ======================================== +// ---------------------------------------------------------------------------- // Types -// ======================================== +// ---------------------------------------------------------------------------- // Properties represents a map of node or relationship props. type Properties map[string]any -// ======================================== +// ---------------------------------------------------------------------------- // Match Key Provider -// ======================================== +// ---------------------------------------------------------------------------- // MatchKeysProvider defines methods for querying a mapping of node labels and // the property keys used to match nodes with them. @@ -46,9 +46,9 @@ func (p *SimpleMatchKeys) GetKeys(label string) ([]string, bool) { return nil, false } -// ======================================== +// ---------------------------------------------------------------------------- // Nodes -// ======================================== +// ---------------------------------------------------------------------------- // Node represents a Neo4j node entity, encapsulating its labels and // properties. @@ -111,9 +111,9 @@ func (n *Node) Serialize() *SerializedNode { return &n.Props } -// ======================================== +// ---------------------------------------------------------------------------- // Relationships -// ======================================== +// ---------------------------------------------------------------------------- // Relationship represents a Neo4j relationship between two nodes, including // its type and properties. diff --git a/schema.go b/schema.go index de76989..2eb6b30 100644 --- a/schema.go +++ b/schema.go @@ -1,18 +1,19 @@ package heartwood import ( + "context" "fmt" + "github.com/neo4j/neo4j-go-driver/v6/neo4j" ) -// ======================================== +// ---------------------------------------------------------------------------- // Schema Match Keys -// ======================================== +// ---------------------------------------------------------------------------- func NewSimpleMatchKeys() *SimpleMatchKeys { return &SimpleMatchKeys{ Keys: map[string][]string{ "User": {"pubkey"}, - "Relay": {"url"}, "Event": {"id"}, "Tag": {"name", "value"}, "ReplacementKey": {"pubkey", "kind"}, @@ -20,9 +21,9 @@ func NewSimpleMatchKeys() *SimpleMatchKeys { } } -// ======================================== +// ---------------------------------------------------------------------------- // Node Constructors -// ======================================== +// ---------------------------------------------------------------------------- func NewUserNode(pubkey string) *Node { return NewNode("User", Properties{"pubkey": pubkey}) @@ -49,9 +50,9 @@ func NewReplacementKeyNode(pubkey string, kind int) *Node { }) } -// ======================================== +// ---------------------------------------------------------------------------- // Relationship Constructors -// ======================================== +// ---------------------------------------------------------------------------- func NewSignedRel( start *Node, end *Node, props Properties) *Relationship { @@ -102,9 +103,9 @@ func NewReferencesReplacementKeyRel( "REFERENCES", "Tag", "ReplacementKey", start, end, props) } -// ======================================== +// ---------------------------------------------------------------------------- // Relationship Constructor Helpers -// ======================================== +// ---------------------------------------------------------------------------- func validateNodeLabel(node *Node, role string, expectedLabel string) { if !node.Labels.Contains(expectedLabel) {