1. 5
  1.  

  2. 2

    I recently started working on a side project and as a fun challenge my goal is to use no libraries outside the stdlib, which includes /x/ parts.

    So far I really like how unnecessary third party packages or big web frameworks have been and how little some basic tiny additions are code wise. I made myself, some simple middleware (just http.Handler chaining) and it works just great.

    Now one problem I have, something I’d love to have is bcrypt or scrypt in stdlib. Since it’s a toy I went with salted sha512 hashes (might do PBKDF2, cause that’s simple enough to write from there) there and as user db for now use something similar to /etc/passwd. Does anyone know what Go’s policy for importing /x/crypto stuff is? The interfaces don’t look like they are going to really change and I think that if so I think it wouldn’t be a big thing to have an agreed upon finalized interface that people are fine with.

    Something I wanted to share is that you can actually use go channels really well for sort of a long polling hub. Where you block a request until you have stuff for it and have the client side wait for it. That kind of surprised me, because I am all to used for Websockets, and seeing that it’s not quite necessary for certain things, without being a complicated, huge overhead workaround simply was really surprising.

    I’d really recommend going for a description of how to do things without third party web frameworks, both to show how things work behind the scenes, but also to show that they often are a thin layer and maybe sometimes expect them to do way more than you think.

    The main feature I think are alternative routers with :param and methods. I thought this would quickly make me stop the project, when starting the project, yet so far I haven’t missed it at all.

    Also no, I won’t go into details or release the code just yet, but may at a later point in time, maybe bits will end up in tutorials such as the one here rather soon though. :)