blob: b44f3eb7dd765232f505a8c4f5d9c4281edaf330 [file] [log] [blame]
package apid
import "net/http"
type APIService interface {
Listen() error
Handle(path string, handler http.Handler) Route
HandleFunc(path string, handlerFunc http.HandlerFunc) Route
Vars(r *http.Request) map[string]string
// for testing
Router() Router
}
type Route interface {
Methods(methods ...string) Route
}
// for testing
type Router interface {
Handle(path string, handler http.Handler) Route
HandleFunc(path string, handlerFunc http.HandlerFunc) Route
ServeHTTP(w http.ResponseWriter, req *http.Request)
}