Datasets
Every fact set the site's examples run on, relation by relation.
Each example on this site names the facts it runs on, and its caption links here. These tables are read from the fixture files the examples use, when the site is built, so they’re exactly the facts behind every answer you see.
graph ¶
A small directed graph: a path a -> b -> c -> d, x on its own, and a weight on every node.
edge(from, to)
| from | to |
|---|---|
| a | b |
| b | c |
| c | d |
node(name)
| name |
|---|
| a |
| b |
| c |
| d |
| x |
weight(node, w)
| node | w |
|---|---|
| a | 1 |
| b | 2 |
| c | 3 |
| d | 4 |
| x | 5 |
The facts as written
# A small directed graph: a path a -> b -> c -> d, x on its own, and a
# weight on every node.
#: edge(from, to)
#: node(name)
#: weight(node, w)
edge("a", "b")
edge("b", "c")
edge("c", "d")
node("a")
node("b")
node("c")
node("d")
node("x")
weight("a", 1)
weight("b", 2)
weight("c", 3)
weight("d", 4)
weight("x", 5)The overview uses this one.
deps ¶
A small Go-style service: its packages, what each imports, its tests, who owns each package, and how many lines each has. cache and config import each other.
package(name)
| name |
|---|
| app |
| api |
| auth |
| db |
| cache |
| config |
| log |
| metrics |
| util |
| legacy |
imports(from, to)
| from | to |
|---|---|
| app | api |
| app | config |
| app | log |
| api | auth |
| api | db |
| api | cache |
| api | log |
| auth | db |
| auth | config |
| auth | log |
| db | config |
| db | log |
| cache | config |
| cache | log |
| config | cache |
| log | util |
| metrics | util |
| legacy | util |
test(name, pkg)
| name | pkg |
|---|---|
| api_test | api |
| auth_test | auth |
| auth_fuzz | auth |
| db_test | db |
| util_test | util |
owner(pkg, team)
| pkg | team |
|---|---|
| app | web |
| api | web |
| legacy | web |
| auth | security |
| db | data |
| cache | data |
| config | platform |
| log | platform |
| metrics | platform |
| util | platform |
loc(pkg, lines)
| pkg | lines |
|---|---|
| app | 300 |
| api | 1200 |
| auth | 800 |
| db | 1500 |
| cache | 400 |
| config | 250 |
| log | 150 |
| metrics | 200 |
| util | 100 |
| legacy | 900 |
The facts as written
# A small Go-style service: its packages, what each imports, its
# tests, who owns each package, and how many lines each has.
# cache and config import each other.
#: package(name)
#: imports(from, to)
#: test(name, pkg)
#: owner(pkg, team)
#: loc(pkg, lines)
package("app"); package("api"); package("auth"); package("db")
package("cache"); package("config"); package("log")
package("metrics"); package("util"); package("legacy")
imports("app", "api"); imports("app", "config")
imports("app", "log")
imports("api", "auth"); imports("api", "db")
imports("api", "cache"); imports("api", "log")
imports("auth", "db"); imports("auth", "config")
imports("auth", "log")
imports("db", "config"); imports("db", "log")
imports("cache", "config"); imports("cache", "log")
imports("config", "cache")
imports("log", "util")
imports("metrics", "util")
imports("legacy", "util")
test("api_test", "api")
test("auth_test", "auth"); test("auth_fuzz", "auth")
test("db_test", "db")
test("util_test", "util")
owner("app", "web"); owner("api", "web"); owner("legacy", "web")
owner("auth", "security")
owner("db", "data"); owner("cache", "data")
owner("config", "platform"); owner("log", "platform")
owner("metrics", "platform"); owner("util", "platform")
loc("app", 300); loc("api", 1200); loc("auth", 800)
loc("db", 1500); loc("cache", 400); loc("config", 250)
loc("log", 150); loc("metrics", 200); loc("util", 100)
loc("legacy", 900)The tutorials, the guide and the rest of the reference use this one. cache and config import each other on purpose, so the recursion examples have a cycle to get through.