News for hackers. Stuff that matters.
Re:Ponzu – An open-source HTTP server framework and CMS in Go by tyingq on Sunday April 09, 2017 @01:51PM (#14073455)
Does look pretty slick, but I imagine the flat nature of the content items will be limiting. In the example, song has an artist. But artist is a string vs a related content item.

I can't tell if that's an MVP type decision and will change later, or a design decision that won't change in the future.

Re:Ponzu – An open-source HTTP server framework and CMS in Go by nilslice on Sunday April 09, 2017 @08:45PM (#14075179)
Hi - you can make a relationship using the built in addon package, github.com/bosssauce/reference

The reference is stored as a string (or []string if you opt for a reference.SelectRepeater input func), but the value stored as a reference is actually a URL path to the content as it would be accessed via the Content API. This becomes very powerful when you enable HTTP/2 Server Push, and declare the referenced content to be pushed when it's parent content is requested.

The underlying data looks like this:

Song

id: 1

title: "Take Me Home, Country Roads"

artist: "/api/content?type=Artist&id=2"

If you enable H2 Server Push by implementing the Pushable interface (add a Push method that returns a []string of the JSON field names to push), the server will know to make a response for the referenced Artist field and push it down to the client when the parent Song is requested.

Re:Ponzu – An open-source HTTP server framework and CMS in Go by tyingq on Sunday April 09, 2017 @08:50PM (#14075205)
Ahh, okay. That seems straightforward. Might be good to reference that in the main documentation.
Re:Ponzu – An open-source HTTP server framework and CMS in Go by nilslice on Sunday April 09, 2017 @08:59PM (#14075249)
Definitely will -- thank you for taking the time to read through.. it's hard for me to know where the docs are too light sometimes. (besides generally everywhere)
Re:Ponzu – An open-source HTTP server framework and CMS in Go by benatkin on Sunday April 09, 2017 @03:04PM (#14073801)
Is it flat like wikipedia or flat like S3?
Re:Ponzu – An open-source HTTP server framework and CMS in Go by tyingq on Sunday April 09, 2017 @04:26PM (#14074194)
Not sure. I don't see any support for item relationships. It could just be a lack of documentation though.