Live data from Hacker News

Create system diagrams with Go

github.com

1–10 of 70 posts

Re: Create system diagrams with Go

#3
The result looks nice. I think this type of diagramming need to be as straightforward as possible, with as little typing as possible. I see you use many different types. For example

gcp.Database.Sql(diagram.NodeLabel("Database"))

What does the NodeLabel type provide that you would not gain with just the string?

Re: Create system diagrams with Go

#4
Very nice, but IMHO this should be the engine behind a file that could easily be parsed such as YML / JSON.

I really don't see the point in having to write a Go snippet to describe the architecture: in the end you're providing only data as an input.

I guess I'll try to do what I just described because I feel like this could have a lot of potential for my system diagrams

Re: Create system diagrams with Go

#5
post #3

The result looks nice. I think this type of diagramming need to be as straightforward as possible, with as little typing as possible. I see you use many different types. For example gcp.Database.Sql(diagram.NodeLabel("Database")) What does the NodeLabel type provide that you would not gain with just the string?

Context

Re: Create system diagrams with Go

#6

Very nice, but IMHO this should be the engine behind a file that could easily be parsed such as YML / JSON. I really don't see the point in having to write a Go snippet to describe the architecture: in the end you're providing only data as an input. I guess I'll try to do what I just described because I feel like this could have a lot of potential for my system diagrams

But with Go you get a schema of sorts. And also, you can easier programmatically generate "dynamic diagrams". For example by letting it parse a YAML file :-)

Re: Create system diagrams with Go

#7

Very nice, but IMHO this should be the engine behind a file that could easily be parsed such as YML / JSON. I really don't see the point in having to write a Go snippet to describe the architecture: in the end you're providing only data as an input. I guess I'll try to do what I just described because I feel like this could have a lot of potential for my system diagrams

yaml is a serialization format. You need at least a schema at which point you might as well write in a nicer language.

Re: Create system diagrams with Go

#8
post #3

The result looks nice. I think this type of diagramming need to be as straightforward as possible, with as little typing as possible. I see you use many different types. For example gcp.Database.Sql(diagram.NodeLabel("Database")) What does the NodeLabel type provide that you would not gain with just the string?

Looks like NodeLabel is a function which allows you to instantiate a NodeOptions with only the label attribute set in a shorthand way. So the functions taking the results of NodeLabel calls are able to accept more complicated options, the examples just don’t show this.

Re: Create system diagrams with Go

#9
post #3

The result looks nice. I think this type of diagramming need to be as straightforward as possible, with as little typing as possible. I see you use many different types. For example gcp.Database.Sql(diagram.NodeLabel("Database")) What does the NodeLabel type provide that you would not gain with just the string?

It's an implementation of the functional option pattern used a lot in go code. See https://dave.cheney.net/2014/10/17/functional-options-for-fr... for a rundown.
Post reply on HN