source

package
v0.68.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("already exists")
	ErrNotFound      = errors.New("not found")
)

Functions

This section is empty.

Types

type Aggregator

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

func NewAggregator

func NewAggregator(configSource *ConfigSource) *Aggregator

func (*Aggregator) ConfigSource

func (a *Aggregator) ConfigSource() *ConfigSource

func (*Aggregator) Load

func (*Aggregator) SetStoreSource

func (a *Aggregator) SetStoreSource(storeSource *StoreSource)

func (*Aggregator) StoreSource

func (a *Aggregator) StoreSource() *StoreSource

type ConfigSource

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

ConfigSource implements Source for in-memory configuration. All operations are thread-safe.

func NewConfigSource

func NewConfigSource() *ConfigSource

func (*ConfigSource) Load

func (s *ConfigSource) Load() ([]v1.ProxyConfigurer, []v1.VisitorConfigurer, error)

Load returns all enabled proxy and visitor configurations. Configurations with Enabled explicitly set to false are filtered out.

func (*ConfigSource) ReplaceAll

func (s *ConfigSource) ReplaceAll(proxies []v1.ProxyConfigurer, visitors []v1.VisitorConfigurer) error

ReplaceAll replaces all proxy and visitor configurations atomically.

type Source

type Source interface {
	// Load loads the proxy and visitor configurations from this source.
	// Returns the loaded configurations and any error encountered.
	// A disabled entry in one source is source-local filtering, not a cross-source
	// tombstone for entries from lower-priority sources.
	//
	// Error handling contract with Aggregator:
	//   - When err is nil, returned slices are consumed.
	//   - When err is non-nil, Aggregator aborts the merge and returns the error.
	//   - To publish best-effort or partial results, return those results with
	//     err set to nil.
	Load() (proxies []v1.ProxyConfigurer, visitors []v1.VisitorConfigurer, err error)
}

Source is the interface for configuration sources. A Source provides proxy and visitor configurations from various backends. Aggregator currently uses the built-in config source as base and an optional store source as higher-priority overlay.

type StoreSource

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

func NewStoreSource

func NewStoreSource(cfg StoreSourceConfig) (*StoreSource, error)

func (*StoreSource) AddProxy

func (s *StoreSource) AddProxy(proxy v1.ProxyConfigurer) error

func (*StoreSource) AddVisitor

func (s *StoreSource) AddVisitor(visitor v1.VisitorConfigurer) error

func (*StoreSource) GetAllProxies

func (s *StoreSource) GetAllProxies() ([]v1.ProxyConfigurer, error)

func (*StoreSource) GetAllVisitors

func (s *StoreSource) GetAllVisitors() ([]v1.VisitorConfigurer, error)

func (*StoreSource) GetProxy

func (s *StoreSource) GetProxy(name string) v1.ProxyConfigurer

func (*StoreSource) GetVisitor

func (s *StoreSource) GetVisitor(name string) v1.VisitorConfigurer

func (*StoreSource) Load

func (s *StoreSource) Load() ([]v1.ProxyConfigurer, []v1.VisitorConfigurer, error)

Load returns all enabled proxy and visitor configurations. Configurations with Enabled explicitly set to false are filtered out.

func (*StoreSource) RemoveProxy

func (s *StoreSource) RemoveProxy(name string) error

func (*StoreSource) RemoveVisitor

func (s *StoreSource) RemoveVisitor(name string) error

func (*StoreSource) UpdateProxy

func (s *StoreSource) UpdateProxy(proxy v1.ProxyConfigurer) error

func (*StoreSource) UpdateVisitor

func (s *StoreSource) UpdateVisitor(visitor v1.VisitorConfigurer) error

type StoreSourceConfig

type StoreSourceConfig struct {
	Path string `json:"path"`
}

Jump to

Keyboard shortcuts

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