Lots of Superfluous Libraries
The framework right now has lots of libraries that really don't necessarily belong with the framework, but are there as remnants of this being an internal project that started before the days of goinstall. All of the libraries that are not central to the framework should probably be moved to separate repositories if they would be useful on their own, or removed if they are no longer useful.
I've started moving things. The template and openid libraries will be the biggest pain, since they were pulled from somewhere (not sure where), and have since been customized to work with the current go, but not really updated. Regardless, they don't belong with the framework, since they don't really do framework-specific things (well, the template library does, but it should use the normal mustache library, not its own copy)
Yesterday I moved util/browser to github.com/crazy2be/browser, today I moved util/http to github.com/crazy2be/httputil and reorganized it a bit. Two down, 18 to go.
Today I moved util/ini to github.com/crazy2be/ini, util/json to github.com/crazy2be/jsonutil, and util/session to github.com/crazy2be/session. Most of the libraries that don't belong in the framework have now been moved out, although there's still a few (notable perms and users) that should be moved out of the framework. There's probably a few of them that should just be deleted...
Plans for the rest of the libraries:
- dlog: Should be removed or changed to a module that simply has side-effects for the logging module (e.g. changes the standard prefixes). As it is now, it's just a crappy copy of the log library that provides a subset of the functionality, created because one iteration of the framework wanted to log everything to stdout rather than stderr. The distinction is irrelevant now, and, as such, so is this logging library.
- diff: Not a real library, just a test. Might be moved to its own repo, might get deleted, might go to my project graveyard. I'm kinda surprised that a better diff library doesn't exist afaik.
- fnotify: Will be replaced by http://github.com/crazy2be/fsmon or the standard library equivalent (if that ever gets created).
- moduled: Staying put, this package actually belongs to the framework. Might move to wfdr/moduled, however.
- openid: Should be replaced by one of the original openid repositories, does not belong as a builtin to the framework (especially seeing as only one module uses it, and it is not required to do openid authentication other than in that module)
- pages: Not sure what to do with this one, it belongs with the pages module really. Maybe put it in wfdr/modules/pages? Is there some way to install these each time a module is compiled? I'll have to look into this...
- paths: Doesn't work without generics... :(
- perms: Should be moved to http://github.com/crazy2be/perms. Part of the framework, but also quite useful on its own.
- picasa: Same story as pages.
- pipes: Should be moved to http://github.com/crazy2be/pipes.
- template: Should be modified to use upstream mustache rather than a slightly-modified copy, and should probably stay where it is.
- user: Same story as session and perms libraries: although this is an important part of the framework, it is also quite useful on its own.
user and perms libraries have been moved to http://github.com/crazy2be/user and http://github.com/crazy2be/perms respectively. Two more down!
dlog and diff have been completely removed. openid functionality has been moved to an external library. user and perms have been moved back into the framework, since that's really where they belong- having them as external packages was useful with the old directory layout and back in the days of goinstall.
Plan for other packages if different from above:
-
picasashould be removed, photos module should be rewritten to use local storage (waiting on @starfruitinc) -
moduledshould eventually be moved into some form of API for interacting with various parts of the wfdr system. The wfdr command should call this API directly, and have little to no code within its main package. -
pagesshould stay put, although it could probably do with a rename. Not sure what the best name would be, open to suggestions. -
pathsshould be removed, it was an experiment that is unlikely to work in the near future. -
permsshould stay put, but needs robustness improvements and maybe an API redesign (it's quite clumsy currently). Should also be integrated better with the framework; checking for read and write permissions should be automatic, not a module developer's chore. -
pipescan stay put for now.wfdr-deamonwill probably change to listen on a TCP port in the future, to allow multiple nodes to communicate, but that's a ways off still. -
sessioncan stay put. Needs robustness improvements and a way to configure multiple backends (i.e. MySQL, NoSQL, FS, etc) -
templatecan say put. -
userneeds further investigation. This package isn't used much in the framework, it might be dropped, or might be improved. It doesn't really have a place in it's current state. -
wfdr-commands are staying put for now.wfdr-module-managerandwfdr-cache-monitorshould probably be merged into thewfdrcommand from the user perspective, and have their functionality moved into a library in the long term.