Documentation ¶
Overview ¶
Package serverinit is responsible for mapping from a Camlistore configuration file and instantiating HTTP Handlers for all the necessary endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCamliPath = errors.New("Invalid Camlistore request path")
Functions ¶
func WriteDefaultConfigFile ¶
WriteDefaultConfigFile generates a new default high-level server configuration file at filePath. If useSQLite, the default indexer will use SQLite, otherwise kv. If filePath already exists, it is overwritten.
Types ¶
type Config ¶
type Config struct { jsonconfig.Obj UIPath string // Not valid until after InstallHandlers // contains filtered or unexported fields }
A Config is the wrapper around a Camlistore JSON configuration file. Files on disk can be in either high-level or low-level format, but the Load function always returns the Config in its low-level format.
func Load ¶
Load returns a low-level "handler config" from the provided filename. If the config file doesn't contain a top-level JSON key of "handlerConfig" with boolean value true, the configuration is assumed to be a high-level "user config" file, and transformed into a low-level config.
func (*Config) InstallHandlers ¶
func (config *Config) InstallHandlers(hi HandlerInstaller, baseURL string, reindex bool, context *http.Request) (shutdown io.Closer, err error)
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)
The returned shutdown value can be used to cleanly shut down the handlers.
type HandlerInstaller ¶
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.