Live data from Hacker News

Go-bootstrap: Generates a lean and mean Go web project

go-bootstrap.io

21–30 of 61 posts

Re: Go-bootstrap: Generates a lean and mean Go web project

#21
post #14

Earlier quoted context omitted.

IMHO, once you've got a db attached, "secure cookies" are a bad idea.

without reference to this project - Perhaps you meant storing all session data is a bad idea versus just an ID? (If so, I'm with you) If not - how would you identify an authenticated user? Or, how would you look up all their relevant session data in the DB?

"securecookies" is a term used, at least in the context of github.com/gorilla/sessions, to refer to a session storage based on encrypting all of the session data and sending it as a cookie. That means all of your session data, including if the user is authenticated and even which user it is, is sent to the browser and back to the server on the next (and subsequent) request(s). This is an interesting concept, but IMHO, rather flawed. About the only valid use is for small micro-apps that don't have any server side persistent storage.

A db based session, which really wouldn't be that hard to set up with github.com/gorilla/sessions, would just send a randomly generated session id to the client in a cookie, save the data in the db, then read that data back out of the db on the next request.

Re: Go-bootstrap: Generates a lean and mean Go web project

#24
post #5

Would love to see something like this for RESTful Web Services built on Go with /users, auth, rate-limiting, etc already working out of the box.

Rate limiting isn't something your app should be concerned about. That should be handled a layer up, e.g. nginx. Chances are it does a much better job than whatever you could come up with.

Re: Go-bootstrap: Generates a lean and mean Go web project

#25
post #21

Earlier quoted context omitted.

without reference to this project - Perhaps you meant storing all session data is a bad idea versus just an ID? (If so, I'm with you) If not - how would you identify an authenticated user? Or, how would you look up all their relevant session data in the DB?

"securecookies" is a term used, at least in the context of github.com/gorilla/sessions, to refer to a session storage based on encrypting all of the session data and sending it as a cookie. That means all of your session data, including if the user is authenticated and even which user it is, is sent to the browser and back to the server on the next (and subsequent) request(s). This is an interesting concept, but IMHO…

Ah - yep, I've betrayed I'm not as familiar with gorilla as I might like to be. Yet.

The way you've described things is how apps I'm familiar with do it (the latter way.) Thanks for clarifying.

Re: Go-bootstrap: Generates a lean and mean Go web project

#26
post #4
post #2

Excellent overview. I'm sick to death of landing pages that are vague, hard to navigate, and leave you wondering what the project is all about; you avoided all of that. In particular, the "Decisions made for you" clearly answers many of the questions someone will have when they investigate a project like this. Kudos.

I can't agree enough! More projects need this "decisions made for you" section in them. Hmm, maybe I should go through the common Ruby frameworks and add a section like this in a pull request...

Indeed, it is one of the best one page introduction for a project I have ever seen. Making me go back to some of my projects and redo the READMEs.

Re: Go-bootstrap: Generates a lean and mean Go web project

#27
>It does not use ORM nor installs one.

Take a look at [1]. Congratulations, you've written an ORM.

The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poorly documented homegrown one instead of a generally accepted solution that has more eyes on it. You are what you claim to be above.

Which is not bad, lightweight ORM is awesome. You could also debate terminology that these are not really objects, but the spirit is still pretty similar to activerecord and sqlalchemy.

[1]https://github.com/go-bootstrap/go-bootstrap/blob/master/bla...

Re: Go-bootstrap: Generates a lean and mean Go web project

#28
post #13
post #9

Earlier quoted context omitted.

I have found the GPL is workable in web projects: https://programmers.stackexchange.com/questions/132485/does-... I understand why people don't like the GPL but its not a showstopper for most business applications.

You are grossly misguided and should consult a lawyer. Linking to a random programmers stackexchange question is an unwise way to make licensing decisions. Per GNU's own faq at https://www.gnu.org/licenses/gpl-faq.html#UnreleasedMods : A company is running a modified version of a GPL'ed program on a web site. Does the GPL say they must release their modified sources? The GPL permits anyone to make a modified version…

You probably are thinking of the AGPL, which would make that requirement. Normal GPL doesn't.

Re: Go-bootstrap: Generates a lean and mean Go web project

#29

>It does not use ORM nor installs one. Take a look at [1]. Congratulations, you've written an ORM. The belief that ORMs are evil is precisely the belief that this sort of code should be repeated everywhere database access is performed. If you have generalized routines for interacting with the database with more comfortable abstractions then string concatenation, you are using an ORM, but possibly a poorly tested, poo…

And if you look at dal/README.md https://github.com/go-bootstrap/go-bootstrap/tree/master/bla... , they say that they got the "data access layer" defintion from wikipedia http://en.wikipedia.org/wiki/Data_access_layer , and in the last line of the wiki page says:

> Object-Relational Mapping tools provide data layers in this fashion, following the active record model. The ORM/active-record model is popular with web frameworks.

:D

Post reply on HN