Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppBuilder ¶
type AppBuilder struct {
// contains filtered or unexported fields
}
AppBuilder constructs the BaseApp components fluently.
func NewAppBuilder ¶
func NewAppBuilder(cfg *config.Config) *AppBuilder
NewAppBuilder creates a new builder.
func (*AppBuilder) Build ¶
func (b *AppBuilder) Build() (*BaseApp, error)
Build finalizes the construction and returns the BaseApp.
func (*AppBuilder) WithKVRuleProcessor ¶
func (b *AppBuilder) WithKVRuleProcessor() *AppBuilder
WithKVRuleProcessor creates a Processor without loading rules from files. Rules are loaded at runtime via KV Watch.
func (*AppBuilder) WithLogger ¶
func (b *AppBuilder) WithLogger() *AppBuilder
WithLogger creates the logger.
func (*AppBuilder) WithMetrics ¶
func (b *AppBuilder) WithMetrics() *AppBuilder
WithMetrics creates the metrics components.
func (*AppBuilder) WithNATSBroker ¶
func (b *AppBuilder) WithNATSBroker() *AppBuilder
WithNATSBroker creates the NATS broker and initializes the KV cache.
type BaseApp ¶
type BaseApp struct {
Logger *slog.Logger
Metrics *metrics.Metrics
Broker *broker.NATSBroker
Processor *rule.Processor
RulesLoader *rule.RulesLoader
MetricsServer *http.Server
Collector *metrics.MetricsCollector
// contains filtered or unexported fields
}
BaseApp holds the common, initialized components for any application.
type RouterApp ¶
type RouterApp struct {
// contains filtered or unexported fields
}
RouterApp represents the shunt application with all its components including KV support
func NewKVRouterApp ¶
NewKVRouterApp creates a shunt application that uses KV Watch for rule management. KV Watch manages subscriptions at runtime.
func (*RouterApp) SetRuleKVManager ¶
func (app *RouterApp) SetRuleKVManager(mgr *broker.RuleKVManager)
SetRuleKVManager assigns the KV manager that watches for rule changes at runtime.