24 lines
361 B
Go
24 lines
361 B
Go
package bond
|
|
|
|
import (
|
|
)
|
|
|
|
type Handler interface {
|
|
Handle(c *Context)
|
|
}
|
|
|
|
// The type is used for custom-one-place implementation
|
|
// of handling.
|
|
type Func func(*Context)
|
|
func (fn Func) Handle(c *Context) {
|
|
fn(c)
|
|
}
|
|
|
|
// The wrapper for the standard http.Handler(s).
|
|
type Wrap struct {
|
|
HttpHandler
|
|
}
|
|
func (w Wrap) Handle(c *Context) {
|
|
w.ServeHTTP(c.W, c.R)
|
|
}
|
|
|