From 0f90f864f63309b6c802a77c52e67fb8a03eecf9 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 14 May 2012 01:51:39 +1000 Subject: [PATCH] Add some serverconfig docs Change-Id: Ibecb0cc21c2273a97956892ed6a37a0f53fd43a2 --- pkg/serverconfig/serverconfig.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/serverconfig/serverconfig.go b/pkg/serverconfig/serverconfig.go index 7fd01221b..c9d518ef9 100644 --- a/pkg/serverconfig/serverconfig.go +++ b/pkg/serverconfig/serverconfig.go @@ -58,6 +58,9 @@ type handlerLoader struct { context *http.Request } +// A HandlerInstaller is anything that can register an HTTP Handler at +// a prefix path. Both *http.ServeMux and camlistore.org/pkg/webserver.Server +// implement HandlerInstaller. type HandlerInstaller interface { Handle(path string, handler http.Handler) } @@ -318,7 +321,11 @@ func (config *Config) checkValidAuth() error { return err } -// context may be nil +// InstallHandlers creates and registers all the HTTP Handlers needed by config +// into the provided HandlerInstaller. +// +// baseURL is required and specifies the root of this webserver, without trailing slash. +// context may be nil (used and required by App Engine only) func (config *Config) InstallHandlers(hi HandlerInstaller, baseURL string, context *http.Request) (outerr error) { defer func() { err := recover()