httphandling

package
v0.0.157 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package for handling of HTTP content

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptHTML

func AcceptHTML(r *http.Request) bool

Types

type PageDisplayer

type PageDisplayer interface {
	DisplayPage(w http.ResponseWriter, templateName string, content interface{})
}

func NewPageDisplayer

func NewPageDisplayer(templates map[string]*template.Template) PageDisplayer

type SessionEnforcer

type SessionEnforcer interface {

	// EnforceValidSession ensures that, if authentication is required, the client has done it
	EnforceValidSession(ctx context.Context, w http.ResponseWriter, r *http.Request) identity.SessionInfo
}

SessionEnforcer defines an interface for enforcing valid HTTP sessions

func NewSessionEnforcer

func NewSessionEnforcer(authenticator identity.Authenticator, pd PageDisplayer) SessionEnforcer

type StaticHandler

type StaticHandler interface {

	// ServeHTTP service a static page
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

StaticHandler knows how to serve static HTTP pages

func NewGcsHandler

func NewGcsHandler(client *storage.Client, bucket string, enforcer SessionEnforcer) StaticHandler

NewStaticHandler creates an implementation of the StaticHandler interface

func NewStaticHandler

func NewStaticHandler(enforcer SessionEnforcer) StaticHandler

NewStaticHandler creates an implementation of the StaticHandler interface

Jump to

Keyboard shortcuts

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