3 ms·
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 differe
by mongol 6y ago
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?
- Anka33 6y agoContext
- jpxw 6y agoLooks 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.
- arankine 6y agoIt'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-friendly-apis https://dave.cheney.net/2014/10/17/functional-options-for-fr... for a rundown.
- erik_seaberg 6y agoIt's a functor, though the type system doesn't let you write a reusable fmap.