source

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domains

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

Domains struct wraps the GitLab client to fetch a domain configuration TODO: remove/refactor this package https://gitlab.com/gitlab-org/gitlab-pages/-/issues/608

func NewDomains

func NewDomains(cfg *config.GitLab) (*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(ctx context.Context, 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.

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(ctx context.Context, name string) (*domain.Domain, error)

GetDomain is a mocked function

func (*MockSource) IsReady added in v1.22.0

func (m *MockSource) IsReady() bool

type Source added in v1.13.0

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

Source represents an abstract interface of a domains configuration source.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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