sources

package
v0.0.0-...-fde7ecd Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificator

type Certificator interface {
	Certificates() (tls.Certificate, error)
}

Certificator provides a source to fetch TLS certificates.

type Mirrorer

type Mirrorer interface {
	Mirrors() map[string]string
}

Mirrorer ensures that a source can provide a mirror configuration.

type Sources

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

Sources maintains one or more sources of image mirrors.

func New

func New() (sources *Sources, err error)

New configures a new mimic Source engine.

func (*Sources) AddMirrorer

func (sources *Sources) AddMirrorer(name string, source Mirrorer)

AddMirrorer adds a new mirror source to the sources engine.

func (*Sources) AddWatcher

func (sources *Sources) AddWatcher(name string, source WatchingMirrorer)

AddWatcher adds a new watcher to the sources engine.

func (*Sources) Certificates

func (sources *Sources) Certificates() tls.Certificate

Certificates retrieves TLS certificates from the configured certificate source.

func (*Sources) Mirrors

func (sources *Sources) Mirrors() (mirrors map[string]string)

Mirrors gathers the map of all mirrors from all configured sources.

func (*Sources) Stop

func (sources *Sources) Stop()

Stop instructs all WatchingMirrorers to stop their watch processes, usually in preparation for an application halt.

func (*Sources) Watch

func (sources *Sources) Watch(cb func(map[string]string))

Watch enables the source watch to be notified of mirror configuration changes without restarting the application.

type WatchingMirrorer

type WatchingMirrorer interface {
	Mirrorer
	WatchMirrors(func()) error
	Stop() error
}

WatchingMirrorer is a source that can receive updates to it's mirror configuration without a restart of the application.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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