source

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsServerlessDomain added in v1.17.0

func IsServerlessDomain(domain string) bool

IsServerlessDomain checks if a domain requested is a serverless domain we need to handle differently.

Domain is a serverless domain when it matches `serverlessDomainRegex`. The regular expression is also defined on the gitlab-rails side, see https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/serverless/domain.rb#L7

Types

type Config added in v1.13.0

type Config client.Config

Config represents an interface that is configuration provider for client capable of comunicating with GitLab

type Domains

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

Domains struct represents a map of all domains supported by pages. It is currently using two sources during the transition to the new GitLab domains source.

func NewDomains

func NewDomains(config Config) (*Domains, error)

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

func (*Domains) GetDomain

func (d *Domains) GetDomain(name string) (*domain.Domain, error)

GetDomain retrieves a domain information from a source. We are using two sources here because it allows us to switch behavior and the domain source for some subset of domains, to test / PoC the new GitLab Domains Source that we plan to use to replace the disk source.

func (*Domains) IsReady added in v1.13.0

func (d *Domains) IsReady() bool

IsReady checks if the disk domain source managed to traverse entire pages filesystem and is ready for use. It is DEPRECATED, because we want to remove it entirely when disk source gets removed.

func (*Domains) Read added in v1.13.0

func (d *Domains) Read(rootDomain string)

Read starts the disk domain source. It is DEPRECATED, because we want to remove it entirely when disk source gets removed.

type MockSource added in v1.13.0

type MockSource struct {
	mock.Mock
}

MockSource can be used for testing

func NewMockSource added in v1.13.0

func NewMockSource() *MockSource

NewMockSource returns a new Source mock for testing

func (*MockSource) GetDomain added in v1.13.0

func (m *MockSource) GetDomain(name string) (*domain.Domain, error)

GetDomain is a mocked function

type Source added in v1.13.0

type Source interface {
	GetDomain(string) (*domain.Domain, error)
}

Source represents an abstract interface of a domains configuration source.

Directories

Path Synopsis
domains
api

Jump to

Keyboard shortcuts

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