africas-talking #50
Reference in New Issue
Block a user
Delete Branch "africas-talking"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adding Africa's Taking (AT) specific functionality
@@ -0,0 +232,4 @@rp := &atRequestParser{}bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)sh := httpserver.ToSessionHandler(bsh, httpserver.WithAtOutput())In general, chainable functions should be called ON the object instead of being an argument TO The object.
@@ -192,2 +194,3 @@//sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl.Init)sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)sh := httpserver.ToSessionHandler(bsh)In fact, I should have implemented this as chainable, too. My bad.
@@ -0,0 +1,123 @@package handlersIt would be better to have this PR against my async branch, because here we cannot see the differences....
I've updated the PR to reflect this
@@ -0,0 +90,4 @@return rqs, err}func (f *BaseSessionHandler) AtOutput(rqs RequestSession) (RequestSession, error) {This method should not exist in the base handler. Please EXTEND the handler to adapt it to your needs.
In fact, you probably need to extend the internal/http/server.go SessionHandler instead, since it in turn extends this, and also provides other functionality you need.
BaseSessionHandler -> http.SessionHandler -> at.SessionHandler
@@ -133,3 +127,1 @@if err != nil {f.writeError(w, 500, "Write result fail", err)returnif f.useAtOutput {Similary here, Please do not put AT speicifc code in the generic http code. Please use your own extension of the class.
WIP: africas-talkingto africas-talking