Documentation ¶
Overview ¶
Package web Cozy Stack API.
Cozy is a personal platform as a service with a focus on data.
Index ¶
- Variables
- func CreateSubdomainProxy(router *echo.Echo, appsHandler echo.HandlerFunc) (*echo.Echo, error)
- func LoadSupportedLocales() error
- func SetupAdminRoutes(router *echo.Echo) error
- func SetupAppsHandler(appsHandler echo.HandlerFunc) echo.HandlerFunc
- func SetupAssets(router *echo.Echo, assetsPath string) (err error)
- func SetupRoutes(router *echo.Echo) error
- type Servers
Constants ¶
This section is empty.
Variables ¶
var ReadHeaderTimeout = 15 * time.Second
ReadHeaderTimeout is the amount of time allowed to read request headers for all servers. This is activated for all handlers from all http servers created by the stack.
Functions ¶
func CreateSubdomainProxy ¶
func CreateSubdomainProxy(router *echo.Echo, appsHandler echo.HandlerFunc) (*echo.Echo, error)
CreateSubdomainProxy returns a new web server that will handle that apps proxy routing if the host of the request match an application, and route to the given router otherwise.
func LoadSupportedLocales ¶
func LoadSupportedLocales() error
LoadSupportedLocales reads the po files packed in go or from the assets directory and loads them for translations
func SetupAdminRoutes ¶
func SetupAdminRoutes(router *echo.Echo) error
SetupAdminRoutes sets the routing for the administration HTTP endpoints
func SetupAppsHandler ¶
func SetupAppsHandler(appsHandler echo.HandlerFunc) echo.HandlerFunc
SetupAppsHandler adds all the necessary middlewares for the application handler.
func SetupAssets ¶
SetupAssets add assets routing and handling to the given router. It also adds a Renderer to render templates.
func SetupRoutes ¶
func SetupRoutes(router *echo.Echo) error
SetupRoutes sets the routing for HTTP endpoints
Types ¶
type Servers ¶
type Servers struct {
// contains filtered or unexported fields
}
Servers contains the started HTTP servers and implement the Shutdowner interface.
func ListenAndServe ¶
ListenAndServe creates and setups all the necessary http endpoints and start them.
func ListenAndServeWithAppDir ¶
ListenAndServeWithAppDir creates and setup all the necessary http endpoints and serve the specified application on a app subdomain.
In order to serve the application, the specified directory should provide a manifest.webapp file that will be used to parameterize the application permissions.
Directories ¶
Path | Synopsis |
---|---|
Package apps is the HTTP frontend of the application package.
|
Package apps is the HTTP frontend of the application package. |
Package auth provides register and login handlers
|
Package auth provides register and login handlers |
Package bitwarden exposes an API compatible with the Bitwarden Open-Soure apps.
|
Package bitwarden exposes an API compatible with the Bitwarden Open-Soure apps. |
Package contacts exposes a route for the myself document.
|
Package contacts exposes a route for the myself document. |
Package data provide simple CRUD operation on couchdb doc
|
Package data provide simple CRUD operation on couchdb doc |
Package files is the HTTP frontend of the vfs package.
|
Package files is the HTTP frontend of the vfs package. |
Package notes is about the documents of cozy-notes.
|
Package notes is about the documents of cozy-notes. |
Package public adds some public routes that can be used to give information to anonymous users, or to the not yet authentified cozy owner on its login page.
|
Package public adds some public routes that can be used to give information to anonymous users, or to the not yet authentified cozy owner on its login page. |
Package settings regroups some API methods to facilitate the usage of the io.cozy settings documents.
|
Package settings regroups some API methods to facilitate the usage of the io.cozy settings documents. |
Package shortcuts is about the .url shortcuts.
|
Package shortcuts is about the .url shortcuts. |
Package status is here just to say that the API is up and that it can access the CouchDB databases, for debugging and monitoring purposes.
|
Package status is here just to say that the API is up and that it can access the CouchDB databases, for debugging and monitoring purposes. |
Package version gives informations about the version of the cozy-stack
|
Package version gives informations about the version of the cozy-stack |