Register built-in engine commands at runtime instead of compile-time

This allows selective loading of commands, and paves the way to dynamic
plugins.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 919665a20a41f8e1b105342b1864ec05eb50cc97
Component: engine
This commit is contained in:
Solomon Hykes
2014-02-24 19:24:29 +00:00
parent 8e9af7eea8
commit 14989a215e
6 changed files with 45 additions and 21 deletions
-4
View File
@@ -50,10 +50,6 @@ func ValidateHost(val string) (string, error) {
type HttpApiFunc func(eng *engine.Engine, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error
func init() {
engine.Register("serveapi", ServeApi)
}
func hijackServer(w http.ResponseWriter) (io.ReadCloser, io.Writer, error) {
conn, _, err := w.(http.Hijacker).Hijack()
if err != nil {