server

package
v0.0.0-...-dae269f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CSRFCookie      = "F" // CSRF cookie sent on a lot of requests
	CSRFCookieField = "@" // form field name __should not be used by anything else__

	SessionCookie  = "x" // name of the cookie to use ; to doubt
	SessionUserKey = "@" // key within the session data to hold the username
)

CSRFCookie, CSRFCookieField, SessionCookie and SessionUserKey hold the names of the cookies and fields used for specific cookies.

These are intentionally kept short to conserve bandwidth.

Variables

This section is empty.

Functions

func WithCSP

func WithCSP(handler http.Handler, policy string) http.Handler

WithCSP adds a Content-Security-Policy header to every response

Types

type Server

type Server struct {
	component.Base
	Dependencies struct {
		Routeables []component.Routeable
		Cronables  []component.Cronable

		Templating *templating.Templating
	}
}

Server represents the running control server.

func (*Server) Context

func (Server) Path

func (control Server) Path() string

func (*Server) Server

func (server *Server) Server(ctx context.Context, progress io.Writer) (public http.Handler, internal http.Handler, err error)

Server returns an http.Mux that implements the main server instance. The server may spawn background tasks, but these should be terminated once context closes.

Logging messages are directed to progress

func (*Server) Stack

func (server *Server) Stack() component.StackWithResources

func (*Server) Trigger

func (server *Server) Trigger(ctx context.Context) error

Trigger triggers the active cron run to immediatly invoke cron.

Directories

Path Synopsis
Package static implements serving of fully static resources
Package static implements serving of fully static resources

Jump to

Keyboard shortcuts

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