Add some serverconfig docs

Change-Id: Ibecb0cc21c2273a97956892ed6a37a0f53fd43a2
This commit is contained in:
Brad Fitzpatrick 2012-05-14 01:51:39 +10:00
parent 5f5da19d45
commit 0f90f864f6
1 changed files with 8 additions and 1 deletions

View File

@ -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()