web

package
v0.0.0-...-ff244ab Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 29 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 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 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) (*echo.Echo, error)

SetupRoutes returns a new web server that will handle DISPERS' routes

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