ingress

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(backend Backend) core.Ingress

New cached ingress. Cache layer simplifies implementation of ingress.

It's guaranteed: - Backend.Set invoked strictly synchronized - All records have unique domains

Types

type Backend

type Backend interface {
	// Set new state of routing tables. All records must have unique domains.
	Set(ctx context.Context, records []Record) error
}

type BackendFunc

type BackendFunc func(ctx context.Context, records []Record) error

func (BackendFunc) Set

func (bf BackendFunc) Set(ctx context.Context, records []Record) error

type ErrDomainUsed

type ErrDomainUsed struct {
	LeaserGroup string
}

func AsErrDomainUsed

func AsErrDomainUsed(err error) (*ErrDomainUsed, bool)

AsErrDomainUsed tries convert arbitrary error as corresponded error type. Returns true only in case conversion successful.

func (*ErrDomainUsed) Error

func (edu *ErrDomainUsed) Error() string

type Record

type Record struct {
	Domain    string   // unique reference to service.
	Addresses []string // host:port, could be multiple in case of scale factor > 1
	Group     string   // namespace, not used in routing
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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