moment. It's at a higher level than something like Rack. It's meant to make
it easy to factor some logic into parameters for web requests as well as
allowing for common code to be shared among handlers, where each handler
shares a Caller interface implementation.
You can find it here http://github.com/timob/httpize
It's got basic HTTP features at the moment. Need POST support and support
for more HTTP response header options.
example:
type mystring string
func (s mystring) Check() bool {
return s != ""
}
type MyCaller func(map[string]httpize.Arg) string
func (f MyCaller) Call(args map[string]httpize.Arg) (io.WriterTo,
*httpize.Settings, err) {
return bytes.NewBufferString(f(args)), nil, nil
}
var _ = httpize.AddType("mystring", func(v string) httpize.Arg {
return mystring(v)
})
var _ = httpize.Handle("/greet?name mystring", MyCaller( func(args
map[string]httpize.Arg) string {
return "Hello " + args["name"].(string)
})
now http://host/greet?name=Gopher is available, but http:/host/greet?name=
will give you a 500 error.
Tim
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.