Skip to content

Instantly share code, notes, and snippets.

@maczniak
Created March 18, 2015 14:00
Show Gist options
  • Save maczniak/e821629475039f65bfeb to your computer and use it in GitHub Desktop.
Save maczniak/e821629475039f65bfeb to your computer and use it in GitHub Desktop.
try) etcd package diagram
<!doctype html>
<html>
<head>
<!--
https://github.com/kisielk/godepgraph
https://github.com/paetzke/go-dep-graph
https://github.com/hirokidaichi/goviz
-->
<title>etcd package diagram</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/3.11.0/vis.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/3.11.0/vis.min.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
#etcd {
width: 800px;
height: 600px;
border: 1px solid lightgray;
}
</style>
</head>
<body>
<div id="etcd"></div>
<script type="text/javascript">
var nodes = [
{id: "client", label: "client"},
{id: "discovery", label: "discovery"},
{id: "error", label: "error"},
{id: "etcdctl", label: "etcdctl"},
//{id: "etcdctl/command", label: "etcdctl/command"},
{id: "etcdmain", label: "etcdmain"},
{id: "etcdserver", label: "etcdserver"},
//{id: "etcdserver/etcdhttp", label: "etcdserver/etcdhttp"},
//{id: "etcdserver/etcdhttp/httptypes", label: "etcdserver/etcdhttp/httptypes"},
//{id: "etcdserver/etcdserverpb", label: "etcdserver/etcdserverpb"},
//{id: "etcdserver/security", label: "etcdserver/security"},
//{id: "etcdserver/stats", label: "etcdserver/stats"},
{id: "integration", label: "integration"},
{id: "main.go", label: "main.go"},
{id: "migrate", label: "migrate"},
//{id: "migrate/cmd/etcd-dump-logs", label: "migrate/cmd/etcd-dump-logs"},
//{id: "migrate/etcd4pb", label: "migrate/etcd4pb"},
//{id: "migrate/functional", label: "migrate/functional"},
//{id: "migrate/starter", label: "migrate/starter"},
//{id: "pkg/coreos", label: "pkg/coreos"},
//{id: "pkg/cors", label: "pkg/cors"},
//{id: "pkg/crc", label: "pkg/crc"},
//{id: "pkg/fileutil", label: "pkg/fileutil"},
//{id: "pkg/flags", label: "pkg/flags"},
//{id: "pkg/idutil", label: "pkg/idutil"},
//{id: "pkg/ioutil", label: "pkg/ioutil"},
//{id: "pkg/netutil", label: "pkg/netutil"},
//{id: "pkg/osutil", label: "pkg/osutil"},
//{id: "pkg/pbutil", label: "pkg/pbutil"},
//{id: "pkg/testutil", label: "pkg/testutil"},
//{id: "pkg/timeutil", label: "pkg/timeutil"},
//{id: "pkg/transport", label: "pkg/transport"},
//{id: "pkg/types", label: "pkg/types"},
//{id: "pkg/wait", label: "pkg/wait"},
{id: "proxy", label: "proxy"},
{id: "raft", label: "raft"},
//{id: "raft/raftpb", label: "raft/raftpb"},
//{id: "raft/rafttest", label: "raft/rafttest"},
{id: "rafthttp", label: "rafthttp"},
{id: "snap", label: "snap"},
//{id: "snap/snappb", label: "snap/snappb"},
{id: "store", label: "store"},
//{id: "tools/etcd-dump-logs", label: "tools/etcd-dump-logs"},
//{id: "tools/etcd-migrate", label: "tools/etcd-migrate"},
//{id: "tools/functional-tester/etcd-agent", label: "tools/functional-tester/etcd-agent"},
//{id: "tools/functional-tester/etcd-agent/client", label: "tools/functional-tester/etcd-agent/client"},
//{id: "tools/functional-tester/etcd-tester", label: "tools/functional-tester/etcd-tester"},
{id: "version", label: "version"},
{id: "wal", label: "wal"},
//{id: "wal/walpb", label: "wal/walpb"},
{id: "golang.org/x/net/context", label: "X net/context", shape: "box"},
{id: "github.com/jonboulle/clockwork", label: "GITHUB jonboulle/clockwork", shape: "box"},
{id: "github.com/codegangsta/cli", label: "GITHUB codegangsta/cli", shape: "box"},
{id: "github.com/prometheus/procfs", label: "GITHUB prometheus/procfs", shape: "box"},
{id: "github.com/prometheus/client_golang/prometheus", label: "GITHUB prometheus/client_golang/prometheus", shape: "box"},
{id: "code.google.com/p/gogoprotobuf/proto", label: "GOOGLE gogoprotobuf/proto", shape: "box"},
{id: "golang.org/x/crypto/bcrypt", label: "X crypto/bcrypt", shape: "box"},
{id: "github.com/stretchr/testify/assert", label: "GITHUB stretchr/testify/assert", shape: "box"},
];
var edges = [
//{from: "client", to: "pkg/types"},
{from: "client", to: "golang.org/x/net/context"},
{from: "discovery", to: "client"},
//{from: "discovery", to: "pkg/testutil"},
//{from: "discovery", to: "pkg/types"},
{from: "discovery", to: "github.com/jonboulle/clockwork"},
{from: "discovery", to: "golang.org/x/net/context"},
//{from: "etcdctl", to: "etcdctl/command"},
{from: "etcdctl", to: "version"},
{from: "etcdctl", to: "github.com/codegangsta/cli"},
//{from: "etcdctl/command", to: "client"},
//{from: "etcdctl/command", to: "etcdserver/etcdserverpb"},
//{from: "etcdctl/command", to: "etcdserver/stats"},
// {from: "etcdctl/command", to: "etcdserver"},
//{from: "etcdctl/command", to: "pkg/idutil"},
//{from: "etcdctl/command", to: "pkg/pbutil"},
//{from: "etcdctl/command", to: "pkg/transport"},
//{from: "etcdctl/command", to: "snap"},
//{from: "etcdctl/command", to: "wal"},
//{from: "etcdctl/command", to: "wal/walpb"},
//{from: "etcdctl/command", to: "github.com/codegangsta/cli"},
//{from: "etcdctl/command", to: "github.com/coreos/go-etcd/etcd"},
//{from: "etcdctl/command", to: "golang.org/x/net/context"},
{from: "etcdmain", to: "discovery"},
{from: "etcdmain", to: "etcdserver"},
//{from: "etcdmain", to: "etcdserver/etcdhttp"},
//{from: "etcdmain", to: "pkg/cors"},
//{from: "etcdmain", to: "pkg/fileutil"},
//{from: "etcdmain", to: "pkg/flags"},
//{from: "etcdmain", to: "pkg/netutil"},
//{from: "etcdmain", to: "pkg/osutil"},
//{from: "etcdmain", to: "pkg/testutil"},
//{from: "etcdmain", to: "pkg/transport"},
//{from: "etcdmain", to: "pkg/types"},
{from: "etcdmain", to: "proxy"},
{from: "etcdmain", to: "rafthttp"},
{from: "etcdmain", to: "version"},
{from: "etcdmain", to: "github.com/prometheus/procfs"}, // _
{from: "etcdserver", to: "discovery"},
{from: "etcdserver", to: "error"},
//{from: "etcdserver", to: "etcdserver/etcdhttp/httptypes"},
//{from: "etcdserver", to: "etcdserver/etcdserverpb"},
//{from: "etcdserver", to: "etcdserver/stats"},
{from: "etcdserver", to: "migrate"},
//{from: "etcdserver", to: "pkg/fileutil"},
//{from: "etcdserver", to: "pkg/flags"},
//{from: "etcdserver", to: "pkg/idutil"},
//{from: "etcdserver", to: "pkg/netutil"},
//{from: "etcdserver", to: "pkg/pbutil"},
//{from: "etcdserver", to: "pkg/testutil"},
//{from: "etcdserver", to: "pkg/timeutil"},
//{from: "etcdserver", to: "pkg/types"},
//{from: "etcdserver", to: "pkg/wait"},
{from: "etcdserver", to: "raft"},
//{from: "etcdserver", to: "raft/raftpb"},
{from: "etcdserver", to: "rafthttp"},
{from: "etcdserver", to: "snap"},
{from: "etcdserver", to: "store"},
{from: "etcdserver", to: "wal"},
//{from: "etcdserver", to: "wal/walpb"},
{from: "etcdserver", to: "github.com/prometheus/client_golang/prometheus"},
{from: "etcdserver", to: "golang.org/x/net/context"},
//{from: "etcdserver/etcdhttp", to: "error"},
//{from: "etcdserver/etcdhttp", to: "etcdserver"},
//{from: "etcdserver/etcdhttp", to: "etcdserver/etcdhttp/httptypes"},
//{from: "etcdserver/etcdhttp", to: "etcdserver/etcdserverpb"},
//{from: "etcdserver/etcdhttp", to: "etcdserver/security"},
//{from: "etcdserver/etcdhttp", to: "etcdserver/stats"},
//{from: "etcdserver/etcdhttp", to: "pkg/testutil"},
//{from: "etcdserver/etcdhttp", to: "pkg/types"},
//{from: "etcdserver/etcdhttp", to: "raft"},
//{from: "etcdserver/etcdhttp", to: "raft/raftpb"},
//{from: "etcdserver/etcdhttp", to: "rafthttp"},
//{from: "etcdserver/etcdhttp", to: "store"},
//{from: "etcdserver/etcdhttp", to: "version"},
//{from: "etcdserver/etcdhttp", to: "github.com/jonboulle/clockwork"},
//{from: "etcdserver/etcdhttp", to: "github.com/prometheus/client_golang/prometheus"},
//{from: "etcdserver/etcdhttp", to: "golang.org/x/net/context"},
//{from: "etcdserver/etcdhttp/httptypes", to: "pkg/types"},
//{from: "etcdserver/etcdserverpb", to: "code.google.com/p/gogoprotobuf/proto"},
//{from: "etcdserver/security", to: "error"},
//{from: "etcdserver/security", to: "etcdserver"},
//{from: "etcdserver/security", to: "etcdserver/etcdserverpb"},
//{from: "etcdserver/security", to: "pkg/types"},
//{from: "etcdserver/security", to: "store"},
//{from: "etcdserver/security", to: "golang.org/x/crypto/bcrypt"},
//{from: "etcdserver/security", to: "golang.org/x/net/context"},
//{from: "etcdserver/stats", to: "raft"},
{from: "integration", to: "client"},
{from: "integration", to: "etcdserver"},
//{from: "integration", to: "etcdserver/etcdhttp"},
//{from: "integration", to: "pkg/testutil"},
//{from: "integration", to: "pkg/transport"},
//{from: "integration", to: "pkg/types"},
{from: "integration", to: "rafthttp"},
{from: "integration", to: "golang.org/x/net/context"},
{from: "main.go", to: "etcdmain"},
//{from: "main.go", to: "migrate/starter"},
{from: "main.go", to: "migrate"},
//{from: "main.go", to: "pkg/coreos"},
//{from: "migrate", to: "etcdserver/etcdserverpb"},
{from: "migrate", to: "etcdserver"},
//{from: "migrate", to: "migrate/etcd4pb"},
//{from: "migrate", to: "pkg/pbutil"},
//{from: "migrate", to: "pkg/types"},
//{from: "migrate", to: "raft/raftpb"},
{from: "migrate", to: "raft"},
{from: "migrate", to: "snap"},
{from: "migrate", to: "store"},
{from: "migrate", to: "wal"},
//{from: "migrate", to: "wal/walpb"},
//{from: "migrate/cmd/etcd-dump-logs", to: "etcdserver/etcdserverpb"},
// {from: "migrate/cmd/etcd-dump-logs", to: "etcdserver"},
//{from: "migrate/cmd/etcd-dump-logs", to: "migrate"},
//{from: "migrate/cmd/etcd-dump-logs", to: "pkg/types"},
//{from: "migrate/cmd/etcd-dump-logs", to: "raft/raftpb"},
// {from: "migrate/cmd/etcd-dump-logs", to: "raft"},
//{from: "migrate/cmd/etcd-dump-logs", to: "wal"},
//{from: "migrate/cmd/etcd-dump-logs", to: "wal/walpb"},
//{from: "migrate/etcd4pb", to: "code.google.com/p/gogoprotobuf/proto"},
//{from: "migrate/starter", to: "client"},
//{from: "migrate/starter", to: "etcdmain"},
//{from: "migrate/starter", to: "migrate"},
//{from: "migrate/starter", to: "pkg/flags"},
//{from: "migrate/starter", to: "pkg/osutil"},
//{from: "migrate/starter", to: "version"},
//{from: "migrate/starter", to: "wal"},
//{from: "migrate/starter", to: "golang.org/x/net/context"},
//{from: "pkg/flags", to: "pkg/transport"},
//{from: "pkg/flags", to: "pkg/types"},
//{from: "pkg/types", to: "pkg/testutil"},
//{from: "proxy", to: "etcdserver/etcdhttp/httptypes"},
{from: "proxy", to: "etcdserver"},
//{from: "raft", to: "pkg/testutil"},
//{from: "raft", to: "raft/raftpb"},
{from: "raft", to: "golang.org/x/net/context"},
//{from: "raft/raftpb", to: "code.google.com/p/gogoprotobuf/proto"},
//{from: "raft/rafttest", to: "raft"},
//{from: "raft/rafttest", to: "raft/raftpb"},
//{from: "raft/rafttest", to: "golang.org/x/net/context"},
//{from: "rafthttp", to: "etcdserver/stats"},
{from: "rafthttp", to: "etcdserver"},
//{from: "rafthttp", to: "pkg/ioutil"},
//{from: "rafthttp", to: "pkg/pbutil"},
//{from: "rafthttp", to: "pkg/testutil"},
//{from: "rafthttp", to: "pkg/types"},
{from: "rafthttp", to: "raft"},
//{from: "rafthttp", to: "raft/raftpb"},
{from: "rafthttp", to: "github.com/prometheus/client_golang/prometheus"},
{from: "rafthttp", to: "golang.org/x/net/context"},
//{from: "snap", to: "pkg/pbutil"},
{from: "snap", to: "raft"},
//{from: "snap", to: "raft/raftpb"},
//{from: "snap", to: "snap/snappb"},
{from: "snap", to: "github.com/prometheus/client_golang/prometheus"},
//{from: "snap/snappb", to: "code.google.com/p/gogoprotobuf/proto"},
{from: "store", to: "error"},
//{from: "store", to: "pkg/types"},
{from: "store", to: "github.com/jonboulle/clockwork"},
{from: "store", to: "github.com/stretchr/testify/assert"},
//{from: "tools/etcd-dump-logs", to: "etcdserver/etcdserverpb"},
// {from: "tools/etcd-dump-logs", to: "etcdserver"},
//{from: "tools/etcd-dump-logs", to: "pkg/pbutil"},
//{from: "tools/etcd-dump-logs", to: "pkg/types"},
//{from: "tools/etcd-dump-logs", to: "raft/raftpb"},
// {from: "tools/etcd-dump-logs", to: "raft"},
//{from: "tools/etcd-dump-logs", to: "snap"},
//{from: "tools/etcd-dump-logs", to: "wal"},
//{from: "tools/etcd-dump-logs", to: "wal/walpb"},
//{from: "tools/etcd-migrate", to: "migrate"},
//{from: "tools/functional-tester/etcd-agent", to: "tools/functional-tester/etcd-agent/client"},
//{from: "tools/functional-tester/etcd-tester", to: "client"},
//{from: "tools/functional-tester/etcd-tester", to: "golang.org/x/net/context"},
//{from: "tools/functional-tester/etcd-tester", to: "tools/functional-tester/etcd-agent/client"},
//{from: "wal", to: "pkg/crc"},
//{from: "wal", to: "pkg/fileutil"},
//{from: "wal", to: "pkg/pbutil"},
//{from: "wal", to: "pkg/types"},
{from: "wal", to: "raft"},
//{from: "wal", to: "raft/raftpb"},
//{from: "wal", to: "wal/walpb"},
{from: "wal", to: "github.com/prometheus/client_golang/prometheus"},
///{from: "wal/walpb", to: "code.google.com/p/gogoprotobuf/proto"},
];
var container = document.getElementById("etcd");
var data = { nodes: nodes, edges: edges };
var options = {
edges: {
style: "arrow",
},
physics: {
barnesHut: {
//gravitationalConstant: -2000,
//centralGravity: 0.1,
},
},
};
var etcd = new vis.Network(container, data, options);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment