Documentation ¶
Overview ¶
Package app helps with configuring and starting server applications from Camlistore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler acts as a reverse proxy for a server application started by Camlistore. It can also serve some extra JSON configuration to the app.
func NewHandler ¶
func NewHandler(conf jsonconfig.Obj, apiHost, appHandlerPrefix string) (*Handler, error)
NewHandler returns a Handler that proxies requests to an app. Start() on the Handler starts the app. The apiHost must end in a slash and is the camlistored API server for the app process to hit. The appHandlerPrefix is the URL path prefix on apiHost where the app is mounted. It must end in a slash, and be at minimum "/". The conf object has the following members, related to the vars described in doc/app-environment.txt: "program", string, required. File name of the app's program executable. Either an absolute path, or the name of a file located in CAMLI_APP_BINDIR or in PATH. "backendURL", string, optional. Automatic if absent. It sets CAMLI_APP_BACKEND_URL. "appConfig", object, optional. Additional configuration that the app can request from Camlistore.
func (*Handler) AppConfig ¶
AppConfig returns the optional configuration parameters object that the app can request from the app handler. It can be nil.
func (*Handler) AuthMode ¶
AuthMode returns the app handler's auth mode, which is also the auth that the app's client will be configured with. This mode should be registered with the server's auth modes, for the app to have access to the server's resources.
func (*Handler) BackendURL ¶
BackendURL returns the appBackendURL that the app handler will proxy to.
func (*Handler) ProgramName ¶
ProgramName returns the name of the app's binary. It may be a file name in CAMLI_APP_BINDIR or PATH, or an absolute path.