Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Pires committed Jan 24, 2023
1 parent a7b60d4 commit d725ec1
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 132 deletions.
Empty file removed Dockerfile
Empty file.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

3 changes: 0 additions & 3 deletions Makefile

This file was deleted.

33 changes: 0 additions & 33 deletions cmd/main.go

This file was deleted.

33 changes: 2 additions & 31 deletions scripts/redisgraph/seed.go → cmd/redisgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,11 @@ import (
)

func main() {

conn, _ := redis.Dial("tcp", "127.0.0.1:6379")
defer conn.Close()

graph := rg.GraphNew("social", conn)

graph.Delete()

john := rg.Node{
Label: "person",
Properties: map[string]interface{}{
"name": "John Doe",
"age": 33,
"gender": "male",
"status": "single",
},
}
graph.AddNode(&john)

japan := rg.Node{
Label: "country",
Properties: map[string]interface{}{
"name": "Japan",
},
}
graph.AddNode(&japan)

edge := rg.Edge{
Source: &john,
Relation: "visited",
Destination: &japan,
}
graph.AddEdge(&edge)

graph.Commit()

query := `MATCH (p:person)-[v:visited]->(c:country)
RETURN p.name, p.age, c.name`

Expand Down Expand Up @@ -79,4 +49,5 @@ func main() {
p, ok := r.GetByIndex(0).(rg.Path)
fmt.Printf("%s %v\n", p, ok)
}

}
43 changes: 43 additions & 0 deletions cmd/seed/seed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package seed

import (
"github.com/gomodule/redigo/redis"
rg "github.com/redislabs/redisgraph-go"
)

func main() {
conn, _ := redis.Dial("tcp", "127.0.0.1:6379")
defer conn.Close()

graph := rg.GraphNew("social", conn)

graph.Delete()

john := rg.Node{
Label: "person",
Properties: map[string]interface{}{
"name": "John Doe",
"age": 33,
"gender": "male",
"status": "single",
},
}
graph.AddNode(&john)

japan := rg.Node{
Label: "country",
Properties: map[string]interface{}{
"name": "Japan",
},
}
graph.AddNode(&japan)

edge := rg.Edge{
Source: &john,
Relation: "visited",
Destination: &japan,
}
graph.AddEdge(&edge)
graph.Commit()

}
13 changes: 0 additions & 13 deletions handlers/api.go

This file was deleted.

13 changes: 0 additions & 13 deletions handlers/web.go

This file was deleted.

17 changes: 0 additions & 17 deletions public_html/templates/index.html

This file was deleted.

1 change: 0 additions & 1 deletion repositories/redisgraph.go

This file was deleted.

0 comments on commit d725ec1

Please sign in to comment.