web

package
v0.0.0-...-4b98c26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 59 Imported by: 0

Documentation

Overview

Package web Cozy Stack API.

Cozy is a personal platform as a service with a focus on data.

Index

Constants

This section is empty.

Variables

View Source
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

func SetupAssets(router *echo.Echo, assetsPath string) (err error)

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

func ListenAndServe() (*Servers, error)

ListenAndServe creates and setups all the necessary http endpoints and start them.

func ListenAndServeWithAppDir

func ListenAndServeWithAppDir(appsdir map[string]string) (*Servers, error)

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.

func (*Servers) Shutdown

func (e *Servers) Shutdown(ctx context.Context) error

Shutdown gracefully stops the servers.

func (*Servers) Start

func (e *Servers) Start()

Start starts the servers.

func (*Servers) Wait

func (e *Servers) Wait() <-chan error

Wait for servers to stop or fall in error.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL