serving

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Writer     http.ResponseWriter
	Request    *http.Request
	LookupPath *LookupPath
	SubPath    string
}

Handler aggregates response/request and lookup path + subpath needed to handle a request and response.

type LookupPath

type LookupPath struct {
	ServingType        string // Serving type being used, like `zip`
	Prefix             string // Project prefix, for example, /my/project in group.gitlab.io/my/project/index.html
	Path               string // Path is an internal and serving-specific location of a document
	SHA256             string
	IsNamespaceProject bool // IsNamespaceProject is DEPRECATED, see https://gitlab.com/gitlab-org/gitlab-pages/issues/272
	IsHTTPSOnly        bool
	HasAccessControl   bool
	ProjectID          uint64
}

LookupPath holds a domain project configuration needed to handle a request

type Request added in v1.17.0

type Request struct {
	Serving    Serving     // Serving chosen to serve this request
	LookupPath *LookupPath // LookupPath contains pages project details
	SubPath    string      // Subpath is a URL path subcomponent for this request
}

Request is a type that aggregates a serving itself, project lookup path and a request subpath based on an incoming request to serve page.

func (*Request) ServeFileHTTP added in v1.17.0

func (s *Request) ServeFileHTTP(w http.ResponseWriter, r *http.Request) bool

ServeFileHTTP forwards serving request handler to the serving itself

func (*Request) ServeNotFoundHTTP added in v1.17.0

func (s *Request) ServeNotFoundHTTP(w http.ResponseWriter, r *http.Request)

ServeNotFoundHTTP forwards serving request handler to the serving itself

type Serving

type Serving interface {
	ServeFileHTTP(Handler) bool
	ServeNotFoundHTTP(Handler)
	Reconfigure(config *config.Config) error
}

Serving is an interface used to define a serving driver

Directories

Path Synopsis
zip

Jump to

Keyboard shortcuts

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