domain

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(rootDomain string, updater domainsUpdater, interval time.Duration)

Watch polls the filesystem and kicks off a new domain directory scan when needed.

Types

type Domain added in v1.9.0

type Domain struct {
	// contains filtered or unexported fields
}

Domain is a domain that gitlab-pages can serve.

func (*Domain) EnsureCertificate added in v1.9.0

func (d *Domain) EnsureCertificate() (*tls.Certificate, error)

EnsureCertificate parses the PEM-encoded certificate for the domain

func (*Domain) GetID added in v1.9.0

func (d *Domain) GetID(r *http.Request) uint64

GetID figures out what is the ID of the project user tries to access

func (*Domain) HasAcmeChallenge added in v1.9.0

func (d *Domain) HasAcmeChallenge(token string) bool

HasAcmeChallenge checks domain directory contains particular acme challenge

func (*Domain) HasProject added in v1.9.0

func (d *Domain) HasProject(r *http.Request) bool

HasProject figures out if the project exists that the user tries to access

func (*Domain) IsAccessControlEnabled added in v1.9.0

func (d *Domain) IsAccessControlEnabled(r *http.Request) bool

IsAccessControlEnabled figures out if the request is to a project that has access control enabled

func (*Domain) IsHTTPSOnly added in v1.9.0

func (d *Domain) IsHTTPSOnly(r *http.Request) bool

IsHTTPSOnly figures out if the request should be handled with HTTPS only by looking at group and project level config.

func (*Domain) IsNamespaceProject added in v1.9.0

func (d *Domain) IsNamespaceProject(r *http.Request) bool

IsNamespaceProject figures out if the request is to a namespace project

func (*Domain) ServeFileHTTP added in v1.9.0

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

ServeFileHTTP implements http.Handler. Returns true if something was served, false if not.

func (*Domain) ServeNotFoundHTTP added in v1.9.0

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

ServeNotFoundHTTP implements http.Handler. Serves the not found pages from the projects.

func (*Domain) String added in v1.9.0

func (d *Domain) String() string

String implements Stringer.

type Map

type Map map[string]*Domain

Map maps domain names to D instances.

func (Map) ReadGroups

func (dm Map) ReadGroups(rootDomain string, fis godirwalk.Dirents)

ReadGroups walks the pages directory and populates dm with all the domains it finds.

Jump to

Keyboard shortcuts

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