Documentation ¶
Index ¶
- Constants
- func SetCSP(w http.ResponseWriter, policy string)
- func WithCSP(handler http.Handler, policy string) http.Handler
- type Server
- func (server *Server) Context(parent component.InstallationContext) component.InstallationContext
- func (server *Server) Path() string
- func (server *Server) Server(ctx context.Context, progress io.Writer) (public http.Handler, internal http.Handler, err error)
- func (server *Server) Stack() component.StackWithResources
- func (server *Server) Trigger(ctx context.Context) error
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 SetCSP ¶
func SetCSP(w http.ResponseWriter, policy string)
SetCSP sets the Content-Security-Policy for the given response Any previously set header is discarded
Types ¶
type Server ¶
Server represents the running control server.
func (*Server) Context ¶
func (server *Server) Context(parent component.InstallationContext) component.InstallationContext
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
Directories ¶
Path | Synopsis |
---|---|
Package static implements serving of fully static resources
|
Package static implements serving of fully static resources |
Click to show internal directories.
Click to hide internal directories.