disk

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 17 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 Disk added in v1.13.0

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

Disk struct represents a map of all domains supported by pages that are stored on a disk with corresponding `config.json`.

func New added in v1.13.0

func New() *Disk

New is a factory method for the Disk source. It is initializing a mutex. It should not initialize `dm` as we later check the readiness by comparing it with a nil value.

func (*Disk) GetDomain added in v1.13.0

func (d *Disk) GetDomain(host string) (*domain.Domain, error)

GetDomain returns a domain from the domains map if it exists

func (*Disk) IsReady added in v1.13.0

func (d *Disk) IsReady() bool

IsReady checks if the domains source is ready for work. The disk source is ready after traversing entire filesystem and reading all domains' configuration files.

func (*Disk) Read added in v1.13.0

func (d *Disk) Read(rootDomain string)

Read starts the domain source, in this case it is reading domains from groups on disk concurrently.

type Group

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

Group represents a GitLab group with project configs and subgroups

func (*Group) Resolve

func (g *Group) Resolve(r *http.Request) (*serving.Request, error)

Resolve tries to find project and its config recursively for a given request to a group domain

type Map

type Map map[string]*domain.Domain

Map maps domain names to Domain 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