New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decouple writefreely library from executable #102
Conversation
This exposes setup and admin functions in the writefreely package, and uses them in the main application, initialized by the flag parsing that now happens there. This is the first step towards making `writefreely` usable as a standalone package.
Now the func takes a username and password instead of a single string.
This adds a new `landing` value in the [app] section of config.ini. If non-empty, unauthenticated users on multi-user instances will be redirected to the path given there. This closes T574
This adds a new `landing` value in the [app] section of config.ini. If non-empty, unauthenticated users on multi-user instances will be redirected to the path given there. This closes T574
(instead of writing out the logic of that helper function) Ref T613
This ensures the writefreely pkg can be used in other applications that need to load mysql themselves -- this can be done by building with the tag: wflib Ref T613
- Adds a new interface, Apper, that enables loading and persisting instance-level data in new ways - Converts some initialization funcs to methods - Exports funcs and methods needed for intialization - In general, moves a ton of stuff around Overall, this should maintain all existing functionality, but with the ability to now better manage a WF instance. Ref T613
This ensures outside application builds will succeed when including the writefreely pkg. Ref T613
All set for review. Again this is just a ton of refactoring, so we're mostly concerned with making sure nothing broke in the process. Issues are most likely to happen in components that need initialization, like:
|
|
||
// Generate keys | ||
initKeyPaths(app) | ||
var keyErrs error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a multierror here? Otherwise we would only report as many as the last of three errors back to the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly.. what's a multierror? I'm not familiar with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a hashicorp library, we could use or implement something simliar. not a msut have but it's nice. https://github.com/hashicorp/go-multierror
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: if you go with that don't forget key/key.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks, that could definitely be the way to go. I added a TODO in both places so we can be sure to tackle this in another iteration.
:lgtm: 👍 |
This moves `hostName` to the `Collection` struct, where it's needed. The field is populated after successful `GetCollection...()` calls. This isn't the cleanest way to do things, but it accomplishes the goal. Eventually, we should accept the AppCfg to `GetCollection...()` calls, or make them `App` methods, instead of `datastore` methods. Ref T613
Thanks for reviewing! Merging now. |
This exposes setup and admin functions in the writefreely package, and
uses them in the main application / executable, initialized by the flag parsing that
now happens there.
This is the first step towards making
writefreely
more usable as astandalone package, and is still a work in progress.