ingresscache

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IngressCache

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

func NewIngressCache

func NewIngressCache(logger logger.Logger) *IngressCache

func (*IngressCache) Delete

func (ic *IngressCache) Delete(host, path string, targets []string) error

func (*IngressCache) Get

func (ic *IngressCache) Get(host, path string) ([]string, error)

func (*IngressCache) Set

func (ic *IngressCache) Set(host, path string, targets []string) error

type IngressHostCache

type IngressHostCache interface {
	IngressHostCacheReader

	// Set adds a new item to the cache for the given host, path and targets. Will overwrite existing values if any
	Set(host string, path string, targets []string) error

	// Delete removes the specified targets from the cache for the given host and path. Will do nothing if host, path or targets do not exist
	Delete(host string, path string, targets []string) error
}

type IngressHostCacheReader

type IngressHostCacheReader interface {
	// Get retrieves all target names for the given host and path
	Get(host string, path string) ([]string, error)
}

type IngressHostsTree

type IngressHostsTree interface {
	// Set sets the targets for a given path. Will overwrite existing values if the path already exists
	Set(path string, targets []string) error

	// Delete removes the targets from the given path and deletes the deepest suffix used only by these targets; does nothing if the path or targets don't exist.
	Delete(path string, targets []string) error

	// Get retrieves the best matching targets for a given path based on longest prefix match
	Get(path string) (Target, error)

	// IsEmpty checks if the tree is empty
	IsEmpty() bool
}

type PairTarget

type PairTarget [2]string

func (PairTarget) Equal

func (p PairTarget) Equal(otherTarget Target) bool

func (PairTarget) ToSliceString

func (p PairTarget) ToSliceString() []string

type SafeTrie

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

func NewSafeTrie

func NewSafeTrie() *SafeTrie

NewSafeTrie creates a new SafeTrie instance

func (*SafeTrie) Delete

func (st *SafeTrie) Delete(path string, targets []string) error

Delete removes the targets from a path and cleans up the longest suffix of the path only used by these targets

func (*SafeTrie) Get

func (st *SafeTrie) Get(path string) (Target, error)

Get retrieve the closest prefix matching the path and returns the associated targets

func (*SafeTrie) IsEmpty

func (st *SafeTrie) IsEmpty() bool

IsEmpty return true if the SafeTrie is empty

func (*SafeTrie) NewTarget

func (st *SafeTrie) NewTarget(inputs []string) (Target, error)

NewTarget returns a Target based on the length of the input slice

func (*SafeTrie) Set

func (st *SafeTrie) Set(path string, targets []string) error

Set adds targets for a given path. If the path does not exist, it creates it

type SingleTarget

type SingleTarget string

func (SingleTarget) Equal

func (s SingleTarget) Equal(otherTarget Target) bool

func (SingleTarget) ToSliceString

func (s SingleTarget) ToSliceString() []string

type Target

type Target interface {
	// Equal returns true if the otherTarget is equal to the current target
	Equal(otherTarget Target) bool

	// ToSliceString returns a slice of targets
	ToSliceString() []string
}

Target defines the trie.PathTrie value

Jump to

Keyboard shortcuts

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