crdcache

package
v0.0.0-...-f7df13b Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MatchTypePathPrefix        = "PathPrefix"
	MatchTypeExact             = "Exact"
	MatchTypeRegularExpression = "RegularExpression"
)

Variables

This section is empty.

Functions

func MatchProbeResponseFromSpec

func MatchProbeResponseFromSpec(specJSON []byte, req *http.Request, logger *zap.Logger) (body string, status int, matched bool)

MatchProbeResponseFromSpec returns the configured response body and HTTP status when spec JSON matches the request using ElastiService CRD probeResponse semantics (path, headers, queryParams, method ANDed). Rules are tried in order; first match wins.

Types

type Cache

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

func New

func New(logger *zap.Logger, operatorRPC *operator.Client, pollInterval time.Duration) *Cache

New creates a Cache that polls the operator every pollInterval.

func (*Cache) GetElastiService

func (c *Cache) GetElastiService(namespacedServiceName string) (*messages.ElastiServiceEntry, bool)

GetElastiService returns the cached entry for "namespace/service-name".

func (*Cache) ListCachedServices

func (c *Cache) ListCachedServices() []CachedService

ListCachedServices returns a stable snapshot of cached ElastiService entries.

func (*Cache) Start

func (c *Cache) Start()

Start begins polling the operator for CRD cache updates.

func (*Cache) StartBackground

func (c *Cache) StartBackground()

func (*Cache) Stop

func (c *Cache) Stop()

type CachedService

type CachedService struct {
	NamespacedName string `json:"namespacedName"`
	messages.ElastiServiceEntry
}

CachedService is one ElastiService in the resolver's local cache (key is namespace/service-name).

Jump to

Keyboard shortcuts

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