provider

package
v0.0.0-...-64e30f5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AliasRefRegex    = regexp.MustCompile(`#\d+`)
	AliasRefRegexOld = regexp.MustCompile(`\$\d+`)
)

Functions

func Validate

func Validate(data []byte) E.NestedError

Types

type DockerProvider

type DockerProvider struct {
	ExplicitOnly bool
	// contains filtered or unexported fields
}

func (*DockerProvider) LoadRoutesImpl

func (p *DockerProvider) LoadRoutesImpl() (routes R.Routes, err E.NestedError)

func (*DockerProvider) NewWatcher

func (p *DockerProvider) NewWatcher() W.Watcher

func (*DockerProvider) OnEvent

func (p *DockerProvider) OnEvent(event W.Event, routes R.Routes) (res EventResult)

func (*DockerProvider) String

func (p *DockerProvider) String() string

type EventResult

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

type FileProvider

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

func (*FileProvider) LoadRoutesImpl

func (p *FileProvider) LoadRoutesImpl() (routes R.Routes, res E.NestedError)

func (*FileProvider) NewWatcher

func (p *FileProvider) NewWatcher() W.Watcher

func (FileProvider) OnEvent

func (p FileProvider) OnEvent(event W.Event, routes R.Routes) (res EventResult)

func (FileProvider) String

func (p FileProvider) String() string

type Provider

type Provider struct {
	ProviderImpl `json:"-"`
	// contains filtered or unexported fields
}

func NewDockerProvider

func NewDockerProvider(name string, dockerHost string) (p *Provider, err E.NestedError)

func NewFileProvider

func NewFileProvider(filename string) (p *Provider, err E.NestedError)

func (*Provider) GetName

func (p *Provider) GetName() string

func (*Provider) GetRoute

func (p *Provider) GetRoute(alias string) (R.Route, bool)

func (*Provider) GetType

func (p *Provider) GetType() ProviderType

func (*Provider) IsExplicitOnly

func (p *Provider) IsExplicitOnly() bool

func (*Provider) LoadRoutes

func (p *Provider) LoadRoutes() E.NestedError

func (*Provider) MarshalText

func (p *Provider) MarshalText() ([]byte, error)

to work with json marshaller.

func (*Provider) RangeRoutes

func (p *Provider) RangeRoutes(do func(string, R.Route))

func (*Provider) StartAllRoutes

func (p *Provider) StartAllRoutes() (res E.NestedError)

func (*Provider) Statistics

func (p *Provider) Statistics() ProviderStats

func (*Provider) StopAllRoutes

func (p *Provider) StopAllRoutes() (res E.NestedError)

type ProviderImpl

type ProviderImpl interface {
	NewWatcher() W.Watcher
	// even returns error, routes must be non-nil
	LoadRoutesImpl() (R.Routes, E.NestedError)
	OnEvent(event W.Event, routes R.Routes) EventResult
	String() string
}

func DockerProviderImpl

func DockerProviderImpl(name, dockerHost string, explicitOnly bool) (ProviderImpl, E.NestedError)

func FileProviderImpl

func FileProviderImpl(filename string) (ProviderImpl, E.NestedError)

type ProviderStats

type ProviderStats struct {
	NumRPs     int          `json:"num_reverse_proxies"`
	NumStreams int          `json:"num_streams"`
	Type       ProviderType `json:"type"`
}

type ProviderType

type ProviderType string
const (
	ProviderTypeDocker ProviderType = "docker"
	ProviderTypeFile   ProviderType = "file"
)

Jump to

Keyboard shortcuts

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